Angular CLI Cheat Sheet: The CLI command An Angular Developer Should Know

    Jul 25, 2020       by Pankaj Kumar
angular-cli-cheatsheet.jpg

Angular is one the most popular javascript front-end framework for creating full-fledged web applications. Angular comes with command line interface to the development faster.In this article, We will see the CLI commands a developer should know.

 

What is Angular CLI?

 

Angular CLI is a command-line interface that is used to create Components, Services, Pipes, modules, and more. It is very helpful for the developers and makes the development faster.

 

Now we will see the list of commons which a Angular developer should 

  1. ng new <application name>: This command mainly creates a new Angular application
  2. ng new <application name> --prefix best: This command creates a new Angular application and set the projects prefix to new.
  3. ng new --help: This command mainly list Angular command.
  4. ng lint my-app: This command checks the selected application for any linting warning
  5. ng lint my-app --fix: It helps in fixing linting error, if there is any
  6. ng lint my-app --format stylish: This formats entire codebase.
  7. ng lint my-app --help: This command list all the available linting command list.
  8. ng generate directive <directive name>: This command generates a new directive. This command can also be written as ng g d <directive name>.
  9. ng generate component <name>: This command mainly creates a new components. This command can also be written in short form as ng g c <name>
  10. ng g s <service name>: This command is used to create a new service.
  11. ng g p <pipe name>: It helps to create a new pipe in our application
  12. ng g cl <destination>: It helps to create a new class in specified directory.
  13. ng build: It helps to create a development build of our Angular application.
  14. ng build --prod: It helps to create production build in angular application.
  15. ng serve -o: It serves the application by opening up the application in a browser using any port 4200 or any other.
  16. ng serve -ssl: Serves the application using SSL.

In this article, I tried to brief the common Angular CLI command any Angular developer should know.

Let me know your thoughts over the email pankaj.itdeveloper@gmail.com. I would love to hear them and If you like this article, share it with your friends.

Thanks,


WHAT'S NEW

Find other similar Articles here: