In this article I am going explain the all Angular CLI commands.
Follow the below given command as per your requirement :
Install
Angular CLI
npm install -g @angular/cli
Angular
command help
ng help
Create
Angular Application
ng new BlogApp
Run
Angular Application
ng serve --open
Run
Angular Application with different port number
ng serve --port 8081
Build
Angular application
ng build
Build
Angular Application for Production
ng build --prod
Add
component
ng g c ArticleList
Add Class
ng g class Article
Add Model
Class
ng g class Article --type=model
Add
Service
ng g s ArticleService
Add
Interface
ng g i Article
Add
Directive
ng g directive TitleCase
Add Module
ng g module Article
Add PIPE
ng g pipe App-pipe
NOTE : If you have noticed that when we generated
component, model etc. the CLI created .spec.ts
file for every component, model, service. This file is not needed, so you can
skip this file when generating component, models or can delete.
To skip
this file use below given command:
ng g c ArticleList --skip-tests
No comments:
Post a Comment