Angular CLI

npm install -g @angular/cli
ng new my-new-app
cd my-new-app
ng serve
ng generate component cmp
ng generate service srv

Get help on the command:

ng serve --help
ng generate component --help
ng generate service --help

Update packages (--allow-dirty flag skips the repo check and does not throw "Repository is not clean" error):

ng update
ng update @angular/cli @angular/core --allow-dirty

Check the linting errors:

ng lint

Deploy to production (all the files will be in the 'dist' folder):

ng build --prod

Install existing project:

npm install

Run this if needed (the terminal will tell you that):

npm audit fix

Links:

Leave a Reply

Your email address will not be published. Required fields are marked *