Angular CLI

Scaffolding Angular Apps

$ whoami

$ whoami

Problem

  • Tasks are redundant
  • Take up a lot of time
  • Contribute to developer frustration

Scaffold

Develop

Test

Publish

Lint

Configure

Installation

$ npm i -g @angular/cli

Scaffolding

ng new ...

$ ng new myapp

Creates a new folder with ready to develop Angular appĀ 

ng generate ...

$ ng g <blueprint> <options>

Generates Angular components, services etc.

Development

ng serve ...

$ ng serve

Pops up a development environment with webpack

Linting

ng lint ...

$ ng lint

Lints the entire application and displays the result on the command line

Configuration

ng set ...

$ ng set <key> <value>

Set the value against the key in the Angular CLI config

ng get ...

$ ng get <key> <value>

Get the value against the key in the Angular CLI config

ng eject ...

$ ng eject

Pulls out the webpack configuration for your app

Testing

ng e2e ...

$ ng e2e <options>

Starts a protractor environment with selenium webdriver for e2e testing

ng test ...

$ ng test

Starts a karma server for unit testing

Publish

ng build ...

$ ng build

Packages the app into a distributable bundle

Miscellaneous

ng help ...

$ ng help <command>

The ultimate help on the CLI

ng version ...

$ ng version

Displays the version of @angular libs

ng completion ...

$ ng completion

Create completion scripts for bash/zsh

Upcoming

CLI for Libs

Signoff

2 days of Angular 2 Awesomeness

Walk in as a noob, walk out as an Angular Pro

Next batch: 5th, 6th May, 2017

Angular CLI

By Mohammad Umair Khan

Angular CLI

  • 1,196