多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
> create a new module of user, ``` ng g module module/user ``` >then open the module/user folder , execute manual command ,due to builder user components ``` ng g component module/user/components/profile ng g component module/user/components/address ng g component module/user/components/others ``` >now ,you have done ,so next action is increase user root component. and you will find out that module of user like the app-root module flaver ``` ng g component module/user ``` >Edit user.module.ts in module/user root , 1:exports self root component ~~~ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ProfileComponent } from './components/profile/profile.component'; import { AddressComponent } from './components/address/address.component'; import { UserComponent } from './user.component'; //self component //if you wanna import self service element import {CommonService} from "./services/common.service"; @NgModule({ declarations: [ProfileComponent, AddressComponent, UserComponent], exports:[ UserComponent //Fixed writing ], providers:[ CommonService, ], imports: [ CommonModule ] }) export class UserModule { } ~~~ >Edit user component.html ~~~ <p>user works!</p> <app-profile></app-profile> ~~~