CLI Commands - aakash14goplani/FullStack GitHub Wiki
-
ng g c <component_name>orng generate component <component_name>: Generates a component in new folder with.ts,.html,.cssand.specfile
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 adistfolder 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
projectsfolder that has this sub-project. It is bit light as it shares all configuration (like node_modules) with main project. Onlyangular.jsonfiles 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=falsecreates a light project i.e. installs all dependencies but omitsappfolder. You then create other sub-projects withinprojects` folder by running pending 2 commands.
- It adds new