📜  Angular CLI-ng add命令

📅  最后修改于: 2020-10-27 02:43:33             🧑  作者: Mango


句法

ng add  [options]

ng将一个npm包添加到工作区。选项是可选参数。

争论

Sr.No. Argument & Syntax Description
1 The name of the package to be added.

选件

Sr.No. Option & Syntax Description
1 –defaults=true|false When true, disables interactive input prompts for options with a default.
2 –help=true|false|json|JSON

Shows a help message for this command in the console.

Default: false

3 –registry=registry The NPM registry to use.
4 –verbose=true|false

Display additional details about internal operations during execution.

Default: false

首先转到使用ng build命令更新的角度项目。

现在运行add命令。

\>Node\>TutorialsPoint> ng add @angular/pwa
Installing packages for tooling via npm.
Installed packages for tooling via npm.
CREATE ngsw-config.json (620 bytes)
CREATE src/manifest.webmanifest (1352 bytes)
CREATE src/assets/icons/icon-128x128.png (1253 bytes)
CREATE src/assets/icons/icon-144x144.png (1394 bytes)
CREATE src/assets/icons/icon-152x152.png (1427 bytes)
CREATE src/assets/icons/icon-192x192.png (1790 bytes)
CREATE src/assets/icons/icon-384x384.png (3557 bytes)
CREATE src/assets/icons/icon-512x512.png (5008 bytes)
CREATE src/assets/icons/icon-72x72.png (792 bytes)
CREATE src/assets/icons/icon-96x96.png (958 bytes)
UPDATE angular.json (3803 bytes)
UPDATE package.json (1332 bytes)
UPDATE src/app/app.module.ts (682 bytes)
UPDATE src/index.html (482 bytes)
√ Packages installed successfully.