ionic2 + cordova app-module

7.1 The concept of module (welcome to join the Q group to learn and discuss together 657185219)

Use of modules: Similar to what we usually call modules, angular2 applications are composed of root modules (app.module.ts) and other submodules.

The function of the module: the attribute is mainly set by @Ngmodule, and then the entire module can be built. The specific attributes are as follows

declarations: the introduction of Components/Pipes

providers: service declaration (declared in the root module, then the service is global, and the submodule declaration is local)

imports: imported and used by other modules, you can use the properties of other module  exports

exports: export your own properties for external use (usually components are exported)

bootstrap: start the module and use the module

entryComponents: Home component

 

7.2 Using app.module.ts

7.3 Use

You can define a module or multiple components in combination with each component to define a module and call it elsewhere, so that the logical structure will be clearer.

Guess you like

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