decorator
Decorator that marks a class as an NgModule and supplies configuration metadata.
Option | Description |
---|---|
providers? |
The set of injectable objects that are available in the injector of this module. |
declarations? |
The set of components, directives, and pipes (declarables) that belong to this module. |
imports? |
The set of NgModules whose exported declarables are available to templates in this module. |
exports? |
The set of components, directives, and pipes declared in this NgModule that can be used in the template of any component that is part of an NgModule that imports this NgModule. Exported declarations are the module's public API. |
entryComponents? |
The set of components to compile when this NgModule is defined, so that they can be dynamically loaded into the view. |
bootstrap? |
The set of components that are bootstrapped when this module is bootstrapped. The components listed here are automatically added to |
schemas? |
The set of schemas that declare elements to be allowed in the NgModule. Elements and properties that are neither Angular components nor directives must be declared in a schema. |
id? |
A name or path that uniquely identifies this NgModule in |
jit? |
When present, this module is ignored by the AOT compiler. It remains in distributed code, and the JIT compiler attempts to compile it at run time, in the browser. To ensure the correct behavior, the app must import |
declarations |
---|
The set of components, directives, and pipes (declarables) that belong to this module. |
|
The set of selectors that are available to a template include those declared here, and those that are exported from imported NgModules. Declarables must belong to exactly one module. The compiler emits an error if you try to declare the same class in more than one module. Be careful not to declare a class that is imported from another module. ExampleThe following example allows the CommonModule to use the @NgModule({ declarations: [NgFor] }) class CommonModule { } |
imports |
---|
The set of NgModules whose exported declarables are available to templates in this module. |
|
A template can use exported declarables from any imported module, including those from modules that are imported indirectly and re-exported. For example, ExampleThe following example allows MainModule to use anything exported by @NgModule({ imports: [CommonModule] }) class MainModule { } |
entryComponents |
---|
The set of components to compile when this NgModule is defined, so that they can be dynamically loaded into the view. |
|
For each component listed here, Angular creates a Angular automatically adds components in the module's bootstrap and route definitions into the |
bootstrap |
---|
The set of components that are bootstrapped when this module is bootstrapped. The components listed here are automatically added to |
|
schemas |
---|
The set of schemas that declare elements to be allowed in the NgModule. Elements and properties that are neither Angular components nor directives must be declared in a schema. |
|
Allowed value are |
id |
---|
A name or path that uniquely identifies this NgModule in |
|
jit |
---|
When present, this module is ignored by the AOT compiler. It remains in distributed code, and the JIT compiler attempts to compile it at run time, in the browser. To ensure the correct behavior, the app must import |
|
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v10.angular.io/api/core/NgModule