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

Show Angular version:

ng --version

Angular CLI commands for scaffolding

ng generate component component-name
ng generate directive directive-name
ng generate pipe pipe-name
ng generate service service-name
ng generate class class-name
ng generate guard guard-name
ng generate interface interface-name
ng generate enum enum-name
ng generate module module-name

Get help on the command:

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

Check the linting errors:

ng lint

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

ng build --prod

Build files to run locally without the server:

ng build --prod --base-href ./

Install existing project:

npm install

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

npm audit fix

Firebase

npm install -g firebase-tools
firebase login
firebase init
firebase deploy

Links:

Leave a Reply

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