parent
99e1c27de6
commit
094f63aaf9
|
@ -7,7 +7,12 @@ block includes
|
|||
:marked
|
||||
**Angular Modules** help organize an application into cohesive blocks of functionality.
|
||||
|
||||
An Angular Module _class_ is adorned with the **NgModule** decorator that defines metadata about the module.
|
||||
An Angular Module is a _class_ adorned with the **@NgModule** decorator function.
|
||||
`_@NgModule` takes a metadata object that tells Angular how to compile and run module code.
|
||||
It identifies the module's _own_ components, directives and pipes,
|
||||
making some of them public so external components can use them.
|
||||
It may add service providers to the application dependency injectors.
|
||||
And there are more options covered here.
|
||||
|
||||
This chapter explains how to **create** `NgModule` classes and how to load them,
|
||||
either immediately when the application launches or later, as needed, via the [Router](router.html).
|
||||
|
@ -74,10 +79,9 @@ a#angular-modularity
|
|||
|
||||
An Angular module is a class decorated with `@NgModule` metadata. The metadata:
|
||||
|
||||
* declare which components, directives and pipes _belong together_.
|
||||
* declare which components, directives and pipes _belong_ to the module.
|
||||
* make some of those classes public so that other component templates can use them.
|
||||
* hide other classes as implementation details.
|
||||
* import other modules with the components, directives and pipes it needs.
|
||||
* import other modules with the components, directives and pipes needed by the components in _this_ module.
|
||||
* provide services at the application level that any application component can use.
|
||||
|
||||
Every Angular app has at least one module class, the _root module_.
|
||||
|
|
Loading…
Reference in New Issue