Difference between revisions of "AngularJS module"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
 
Line 18: Line 18:
 
* [[JavaScript library]]
 
* [[JavaScript library]]
 
* [[Web application]]
 
* [[Web application]]
 +
 +
== External links ==
 +
 +
* [https://angular.io/docs/ts/latest/cookbook/ngmodule-faq.html Angular Module FAQs]
  
 
[[Category:AngularJS]]
 
[[Category:AngularJS]]
 
[[Category:Web design and development]]
 
[[Category:Web design and development]]
 
[[Category:JavaScript]]
 
[[Category:JavaScript]]

Latest revision as of 12:09, 22 February 2017

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.

See also

External links