AngularJS module
From Wiki @ Karl Jones dot com
Revision as of 09:57, 9 January 2017 by Karl Jones (Talk | contribs)
In AngularJS, modules help organize an application into cohesive blocks of functionality.
An Angular module is a class decorated 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.
ES5 JavaScript does not have a native module system. There are several popular third party module systems available.
Module interaction
In Angular apps, modules reference other modules using the app
object.
When another module needs to refer to AppComponent
, it gets it from app.AppComponent
.