1、安装
npm install -g @angular/cli
//安装插件--vsCode有提示
Angular Snippets (Version 8)
2、创建项目和启动项目
//创建项目
ng new my-dream-app
//启动项目
ng serve
3、vsCode创建组件
3-1、命令行生成(推荐)
ng g component components/header
//项目结构
app.module.ts //根模块
@NgModule({
// 注册组件
declarations: [
AppComponent,
HeaderComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
3-2、手动创建(需手动引入)
//安装插件
Angular Files
4、Angular引入ng-zorro-antd
ng-zorro
全局引入
//vsCode命令行
ng add ng-zorro-antd
主组件内容被清空,需在.html中重新引入子组件
5、看到所有vsCode命令行的命令
ng g
