• Overview
@angular/core

NgModule

decorator

Decorator that marks a class as an NgModule and supplies configuration metadata.

  
    @NgModule ({})
  
  

providers

(Provider | EnvironmentProviders)[] | undefined

The set of injectable objects that are available in the injector of this module.

declarations

(any[] | Type<any>)[] | undefined

The set of components, directives, and pipes (declarables that belong to this module.

imports

(any[] | Type<any> | ModuleWithProviders<{}>)[] | undefined

The set of NgModules whose exported declarables are available to templates in this module.

exports

(any[] | Type<any>)[] | undefined

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.

A declarable belongs to one and only one NgModule. A module can list another module among its exports, in which case all of that module's public declaration are exported.

bootstrap

(any[] | Type<any>)[] | undefined

The set of components that are bootstrapped when this module is bootstrapped.

schemas

(any[] | SchemaMetadata)[] | undefined

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 NO_ERRORS_SCHEMA and CUSTOM_ELEMENTS_SCHEMA.

id

string | undefined

A name or path that uniquely identifies this NgModule in getNgModuleById. If left undefined, the NgModule is not registered with getNgModuleById.

jit

true | undefined

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 @angular/compiler.

Jump to details