Angular CLI

Angular CLI Commands Thease are command,which is use for multiple purposes from angular installation to till production release.

npm install -g @angular/cli@ — Install Angular NPM globally

npm uninstall -g @angular/cli@

@ — is optional parameter.

npm cache clean — Clear the cache

npm cache verify — verify the npm cache is clear.

ng -v – angular CLI version

ng new – create new Angular Application.

ng g m - create Angular Module. m – Module

ng g m –routing — this will create routing module as well.

ng g c / — Create new Component is Optional.

— Flat true/false – Seperated folder or not.

–inline-template ( -it ) — Separated HTML template will not create.

–inline-style ( -is ) — Separated CSS or SCSS file will not create.

–spec ByDefault true can be fix false — will not create Unit test spec file.

–view-encapsulation( -ve ) – View Encapsulation Strategy

–change-detection ( -cd ) – can be set OnPush Strategy

–dry-run ( -d )

ng g s — Generate the Service

ng g g — Generate the Gurad class

ng g cl — cl – Class — Generate a Typescript class

ng g d — d – directive — Generate a Directive

ng g p — p – Pipe — Generate a Pipe

ng g i — i- Interface — Generate a Interface

ng g e — e – Enum — Generate a Enum Class

ng serve — RUN Angular app default 4200 port

ng serve -o — will open the browser by default.

ng serve –port 8080 – Angular Application will run on the 8080 port

ng serve –live-reload – Reload when change occur

ng servev –ssl Using HTTPS

–proxy-config — pc —

ng serve -aot – Angular RUN same as in the production mode to avoid the surprise on the ng build

ng build –prod — Angular run on production build mode.

ng build -sm ( –sourcemap )

ng build –aot

ng build –watch

ng build –environment

ng build –target

ng build –dev

ng build –base-href (–bh)// like /APP/

ng set defaults.styleExt scss – Angular CLI default stylesheet format is CSS. Can be change to SCSS file.

ng test –single-run

ng test –progress

ng test –colors

ng e2e –s ( Serve ) –ee ( element-explorer ) –c ( Config ) –sp ( specs ) –wu ( webdriver-update )

results matching ""

    No results matching ""