Angular 创建组件

## 创建组件 1. 定义`hello.component.ts`组件 2. 在`app.module.ts`中引用并添加到`declarations`声明中 3. 在`app.component.html`中使用组件``

命令创建

  1. 安装Angular 5 Snippets,输入命令ng-component自动生成组件结构
  2. 使用ng命令自动创建模块: ng generate component component-name
  3. 组件会自动加入到declarations声明中
posted @ 2018-01-08 10:33  林宇风  阅读(3607)  评论(0编辑  收藏  举报