AngularJS module

From Wiki @ Karl Jones dot com
Revision as of 13:45, 31 December 2016 by Karl Jones (Talk | contribs)

Jump to: navigation, search

In AngularJS, a module is a unit of code.

Angular apps are modular. They consist of many files each dedicated to a purpose.

ES5 JavaScript doesn't have a native module system. There are several popular 3rd 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.

Angular modularity

Angular is also modular. It is a collection of library modules. Each library is itself a module made up of several, related feature modules.

When we need something from Angular, we use the ng object.

See also