Schematics

ng-zorro-antd support schematics, you can init configuration and generate component with schematics now.

Init Project#

Init project with ng-zorro-antd.

Run ng add ng-zorro-antd in your project directory, and follow the options to configure.

You can choose a preset template to create your project, then develop on this basis code.

Command#

ng add ng-zorro-antd [options]

Options#

--theme

ng-zorro-antd will create theme.less in src folder.

You can get more information at the Customize Theme part.

--locale

If you add --locale=[language]ng-zorro-antd import the language package and the i18n part of angular in the app.module.ts.

The default i18n config of ng-zorro-antd is zh_CN now,you can get more information at the Internationalization part.

--animations

Enable the BrowserAnimationsModule your app module

--gestures

Install and import hammerjs for gesture support in your project

Component Generation#

You can get component generation code in our doc after expand the code panel below every example.

Command#

ng g ng-zorro-antd:[schematic] <name> [options]

For example, you can generate an login form with the follow command.

ng g ng-zorro-antd:form-normal-login login