October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Angular NO_ERRORS_SCHEMA: What It Does and When to Use It

NO_ERRORS_SCHEMA lets Angular accept any property on any element, but broad suppression can conceal template mistakes. Learn when to use it—and when a narrower fix is better.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

NO_ERRORS_SCHEMA tells Angular to accept any property on any element in a template, including elements and properties Angular does not otherwise recognize. That can quiet unknown-element or unknown-property errors, but it also weakens template validation and can conceal mistakes. For a custom web component, CUSTOM_ELEMENTS_SCHEMA is usually the narrower option to evaluate; for a binding type error, use Angular’s template type-checking guidance instead.

What does NO_ERRORS_SCHEMA do?

NO_ERRORS_SCHEMA is a schema constant exported by @angular/core. Angular defines it as a schema that “allows any property on any element.” In practice, it suppresses template errors about elements or properties that Angular does not recognize in the relevant compilation context. See the Angular NO_ERRORS_SCHEMA API reference.

As an Amazon Associate I earn from qualifying purchases.

A schema changes what Angular accepts during template validation; it does not add a component, directive, or property implementation to your application. If a component is missing from the compilation context, or a property name is misspelled, the schema may make the template compile without fixing the underlying issue.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should you use it to fix an unknown element or property?

Usually, first identify why Angular does not recognize the template element or binding. Check that the component or directive is declared or imported in the context that owns the template, and verify the element and property names. Angular generally discourages NO_ERRORS_SCHEMA because it prevents useful validation and may hide real template errors.

  • Use it only when broad acceptance of otherwise-unrecognized elements and properties is intentional.
  • Do not apply it as a catch-all for unrelated compiler errors; it addresses unknown elements and properties, not every template problem.
  • Prefer a narrower solution when the template contains a web component or when the complaint is about a binding’s type.

NO_ERRORS_SCHEMA vs. CUSTOM_ELEMENTS_SCHEMA

Choose based on what the template contains and what Angular is reporting. Angular documents the schemas’ scopes as follows:

Schema Documented scope When to consider it
NO_ERRORS_SCHEMA Allows any property on any element. Only when broad acceptance of unknown elements and properties is deliberate, with the loss of validation understood.
CUSTOM_ELEMENTS_SCHEMA Allows non-Angular elements named in dash case and dash-case element properties. When the template uses custom elements such as <my-widget> and properties within that documented scope.

CUSTOM_ELEMENTS_SCHEMA is not a general allowance for every unknown element or arbitrary property. Check Angular’s CUSTOM_ELEMENTS_SCHEMA API reference and advanced configuration guide against the names and bindings in your template.

Where do you configure the schema?

Put the schema where Angular configures the component or module that owns the template. The exact location depends on your application’s structure:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Standalone component: add a schemas property to that component’s decorator metadata. Angular’s Component API documents this property for standalone components.
  • NgModule-based application: add the schema to the relevant module’s schemas metadata. The NgModule API lists NO_ERRORS_SCHEMA and CUSTOM_ELEMENTS_SCHEMA as accepted schema values.

Use the configuration style supported by your Angular version and component organization. Avoid adding a broad schema at a higher level simply to silence errors across unrelated templates.

What if the error is about a binding’s type?

A binding type error is different from an unknown-element or unknown-property error. A schema is not the right first response to a type mismatch. Consult Angular’s template type-checking guide to understand the diagnostic and the strictness setting involved.

For a specific expression that is a known false positive, Angular documents narrower options, including casting that expression with $any() or adjusting an individual strictness flag. These approaches preserve more template checking than allowing any property on any element.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does NO_ERRORS_SCHEMA disable Angular security protections?

The cited API defines NO_ERRORS_SCHEMA as a template schema for accepting elements and properties Angular does not recognize. It does not establish that the schema disables Angular sanitization or directly creates an XSS vulnerability. Template schema validation and Angular’s handling of trusted values and sanitization are separate concerns; see the Angular security guide for the latter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.