Skip to content

Command#

  1. Setup

    Command Description
    npm install -g @angular/cli install Angular CLI globally
  2. Create Application

    Command Description
    ng new [name] create new project
    ng new [name] --routing create project with routing
    ng new [name] -s will the style be in .ts file
    ng new [name] -S will not generate spec file
    ng new [name] --create-application false only create the workspace
  3. Generate

    Command Description
    ng g app [name] create new app in the project
    ng g c [name] create component
    ng g s [name] create service
    ng g cl [name] create class
    ng g lib [name] create library
  4. Build

    Command Description
    ng serve run the project
    ng serve -o open app in the default browser
    ng serve --ssl use the HTTPS
    ng serve --port [number] use specific port
    ng serve build build app to dist folder
  5. Other

    Command Description
    ng version check angular version