
This allows Angular to error on unknown properties, allowing applications that don’t use custom elements to get better error reporting. Part of #10043 BREAKING CHANGE: - By default, Angular will error during parsing on unknown properties, even if they are on elements with a `-` in their name (aka custom elements). If you application is using custom elements, fill the new parameter `@NgModule.schemas` with the value `[CUSTOM_ELEMENTS_SCHEMA]`. E.g. for bootstrap: ``` bootstrap(MyComponent, {schemas: [CUSTOM_ELEMENTS_SCHEMA]}); ```
38 lines
1.6 KiB
TypeScript
38 lines
1.6 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {ApplicationRef, NgModule} from '@angular/core';
|
|
import {FormsModule} from '@angular/forms';
|
|
import {BrowserModule} from '@angular/platform-browser';
|
|
|
|
import {AnimateCmp} from './animate';
|
|
import {BasicComp} from './basic';
|
|
import {CompWithAnalyzeEntryComponentsProvider, CompWithEntryComponents} from './entry_components';
|
|
import {CompWithProviders, CompWithReferences, ModuleUsingCustomElements} from './features';
|
|
import {CompUsingRootModuleDirectiveAndPipe, SomeDirectiveInRootModule, someLibModuleWithProviders, SomePipeInRootModule, SomeService} from './module_fixtures';
|
|
import {ProjectingComp} from './projection';
|
|
import {CompWithChildQuery, CompWithDirectiveChild} from './queries';
|
|
|
|
@NgModule({
|
|
declarations: [
|
|
SomeDirectiveInRootModule, SomePipeInRootModule, AnimateCmp, BasicComp, CompWithEntryComponents,
|
|
CompWithAnalyzeEntryComponentsProvider, ProjectingComp, CompWithChildQuery,
|
|
CompWithDirectiveChild, CompUsingRootModuleDirectiveAndPipe, CompWithProviders,
|
|
CompWithReferences
|
|
],
|
|
imports: [BrowserModule, FormsModule, someLibModuleWithProviders(), ModuleUsingCustomElements],
|
|
providers: [SomeService],
|
|
entryComponents: [
|
|
AnimateCmp, BasicComp, CompWithEntryComponents, CompWithAnalyzeEntryComponentsProvider,
|
|
ProjectingComp, CompWithChildQuery, CompUsingRootModuleDirectiveAndPipe
|
|
]
|
|
})
|
|
export class MainModule {
|
|
constructor(public appRef: ApplicationRef) {}
|
|
}
|