Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rajaramtt/d835164bd4fc4227ee403e921e3d4953 to your computer and use it in GitHub Desktop.
Save rajaramtt/d835164bd4fc4227ee403e921e3d4953 to your computer and use it in GitHub Desktop.
CUSTOM_ELEMENTS_SCHEMA vs NO_ERRORS_SCHEMA in Angular8

Including the CUSTOM_ELEMENTS_SCHEMA in the module allows the use of the web components in the HTML markup without the compiler producing errors

  • Defines a schema that allows an NgModule to contain the following:
    • Non-Angular elements named with dash case (-).
    • Element properties named with dash case (-).
  • Dash case is the naming convention for custom elements.

https://angular.io/api/core/CUSTOM_ELEMENTS_SCHEMA

The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized elements and attributes.

  • Defines a schema that allows any property on any element.

https://angular.io/guide/testing#no_errors_schema https://angular.io/api/core/NO_ERRORS_SCHEMA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment