Build Tasks Angular CLI Build Tasks

Command Line Build Tasks

Important: Make sure you have Node 6.11.1 or greater!

First install the CLI

npm install -g @angular/cli@latest

Local server

Serve your app locally by navingating to the directory and running:

ng serve

Which will serve to http://localhost:4200/ by default.

Generating content

You can use the ng generate (or just ng g )

ng g component my-new-component

You can find all possible blueprints in the table below:

Scaffold Usage
Component ng g component my-new-component
Directive ng g directive my-new-directive
Pipe ng g pipe my-new-pipe
Service ng g service my-new-service
Class ng g class my-new-class
Interface ng g interface my-new-interface
Enum ng g enum my-new-enum
Build Docs