10 Angular/CLI Common Commands which all front-end developers should know.

3/28/2018 Angular AngularCLI FrontEnd

In this article I will describe 10 common command which you need to know when you are using Angular/CLI.

1. Installation

To install angular/cli use the following command:

  npm i -g @angular/cli 

2. Create a Project

To create a project based on angular/cli use the following command:

  ng new [your-project-name]

3. Create a component

  ng generate component [component-name]
  ng g c [component-name]
  ng g c directory/[component-name]

4. Create a Module

  ng generate module [module-name]
  ng g m [module-name]
  ng g m directory/[module-name]

5. Create a Service

  ng g service [service-name]
  ng g s [service-name]

5. Create a Pipe

  ng g pipe [pipe-name]
  ng g  [pipe-name]

6. Create a Directive

  ng g directive [directive-name]
  ng g d [directive-name]

7. Build

  ng build
  ng build -p

8. Lint

  ng lint   

9. Serve as an application

  ng serve
  ng serve --port [port-no]

10. Open Documentation

  ng doc
  ng doc [terms for search]