1. 创建项目
1. ng new ccwserve
2. cnpm install
3. cnpm install ng-zorro-antd --save
2. 配置
覆盖 /src/app/app.module.ts
中的文件内容
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule,
NgZorroAntdModule.forRoot()
],
bootstrap: [AppComponent]
})
export class AppModule { }
3. 配置使用
修改 .angular-cli.json
文件的 styles
列表
<button nz-button nzType="primary">Button</button>
4. 运行
ng serve --port 0 --open