-
Notifications
You must be signed in to change notification settings - Fork 1
CLI Commands
Aakash Goplani edited this page Mar 29, 2020
·
9 revisions
-
ng g c <component_name>
orng generate component <component_name>
: Generates a component in new folder with.ts
,.html
,.css
and.spec
file
ng g c <component_name> --skipTests=true
: generates a component in a new folder without spec files -
ng serve
: Builds and serves your app, rebuilding on file changes -
npm install --save-dev bootstrap@3
: install package in DEV only -
ng new <project_name>
: creates new angular project -
Upgrade to new angular version:
ng update @angular/cli @angular/core
-
ng build --prod
: builds adist
folder that contains code which will be deployed to PROD. -
ng add <package_name>
: adds new package -
Create sub-projects:
ng generate application <sub_project_name> ng serve --project=<sub_project_name>
- It adds new
projects
folder that has this sub-project. It is bit light as it shares all configuration (like node_modules) with main project. Onlyangular.json
files gets updated. - If you already know that your project is going to have many sub projects, you can configure that in start:
ng new --create-application=false ng generate application <sub_project_name> ng serve --project=<sub_project_name>
-
--create-application=false
creates a light project i.e. installs all dependencies but omitsapp
folder. You then create other sub-projects within
projects` folder by running pending 2 commands.
- It adds new