> 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>
~~~
- 引言
- 安装angular9
- 入门
- 数据绑定
- 属性绑定
- 实体字符和转义
- html 模板运算
- css样式规范
- 数组与循环ngFor
- 条件ngIf
- 管道
- 事件执行
- 双向数据绑定mvvm
- todolist页面交互
- 公共服务层
- 数据持久化
- dom与ViewChild装饰器
- 父子组件传值
- 子父组件传值ViewChild
- 子父组件out装饰器
- 生命周期-挂/卸载
- es6语法io异步promise
- Rxjs异步数据流编程
- http_request
- axios异步数据
- 英雄route路由
- 动态route路由
- navigate route
- Parent child routing
- modularization
- lazyload