Monday, August 28, 2017

Quick cheat-sheet on Angular/cli

Quick cheat-sheet on Angular/cli to generate boiler plate codes.

Install Angular/cli
npm install –g @angular/cli

Check Agnular/cli version
ng –v
npm list –g  @angular/cli --depth=0

Generate  files without installing it
ng new ng2CliApp --skip-install

Create new project with out writing the files in but report them commandline console
ng new ng2CliApp --dry-run

Create new project with app prefix
ng new ng2CliApp --prefix coolapp --dry-run

Create new project without test files
ng new ng2CliApp  --skip-tests --prefix cool_ng2CliApp --dry-run

Create new project with style-sheets
ng new ng2CliApp --skip-tests --prefix cool_ng2CliApp --style scss 

Create new project with Routing
ng new ng2CliApp --routing --skip-tests --prefix cool_ng2CliApp --style scss --skip-install

Create new Component
ng g component my-new-component

Create new Directive
ng g directive my-new-directive

Create new Pipe
ng g pipe my-new-pipe

Create new Service
ng g service my-new-service

Create new Class
ng g class my-new-class

Create new Guard
ng g guard my-new-guard

Create new Interface
ng g interface my-new-interface

Create new Create new Enum
ng g enum my-new-enum

Create new Module
ng g module my-module

Lint typescript code
ng lint 
Lint help
ng lint --help

Angular/cli help
ng --help



Post a Comment


© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me