Angularjs 2 library



 

Angular is packaged as a collection of JavaScript modules. You can understand it as a library module.
Every Angular library is named with the @angular prefix.
These libraries are installed via the npm package manager, and the used parts are imported via the JavaScript import statement.
For example, importing the Angular component modifier library from @angular/core looks like this:

import { Component } from '@angular/core';

You can also import Angular modules from Angular libraries using the JavaScript import statement :

import { BrowserModule } from '@angular/platform-browser';

In the simple example of the root module above, the application module needs the functionality in the BrowserModule. To access these functions, add the import of @NgModule metadata as follows:

imports:      [ BrowserModule ],

This way we use both the Angular and JavaScript module systems.
It's easy to confuse the two systems because they both share the same words "imports" and "exports". But put it aside for now, time and experience will gradually clear up this confusion.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326442514&siteId=291194637