填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

ng add

Adds support for an external library to your project.

ng add <collection> [options]
      
      ng add <collection> [options]
    

说明

Adds the npm package for a published library to your workspace, and configures the project in the current working directory (or the default project if you are not in a project directory) to use that library, as specified by the library's schematic. For example, adding @angular/pwa configures your project for PWA support:

ng add @angular/pwa
      
      ng add @angular/pwa
    

The default project is the value of defaultProject in angular.json.

参数

参数说明
<collection>

The package to be added.

选项

选项说明
--defaults=true|false

When true, disables interactive input prompts for options with a default.

--help=
true|false|json|JSON

Shows a help message for this command in the console.

默认值: false

--interactive=true|false

When false, disables interactive input prompts.

--registry=registry

The NPM registry to use.

--verbose=true|false

Display additional details about internal operations during execution.

默认值: false