Schematics

Using a CLI helps initialize projects, generate template codes and reduce development time.

Theng-zorro-antd scaffolding is essentially based on schematics.

Initialize A Project#

Initialize a project with ng-zorro-antd.

Run the command ng add ng-zorro-antd under your project directory, and follow the options to configure settings including whether you want to import i18n files and stylesheets, and load initial modules.

NG-ZORRO CLI

In the meantime, you can choose an existing project template while creating your project, and then develop the project on the basis of it.

Command#

ng add ng-zorro-antd [options]

Component Generation#

There are template source codes under every component API show case, you may obtain these codes by expanding Show Code.

Command#

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

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

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