Angular cli commands list

Angular cli commands list

In this post we will give you information about Angular cli commands list. Hear we will give you detail about Angular cli commands listAnd how to use it also give you demo for it if it is necessary.

we will learn about some basic commands which are commonly used in Angular cli.

ng new

This command is used to create a new angular project.

ng new myapp

ng generate

This command is used to generate new components, routing modules, services, and guards.

Create new components

ng generate component myfirst-component#where myfirst-component is your component name

This above command can also be written as

ng g c myfirst-component# g means generate# c means component

Create new services

ng g s  my-service#s means service

This above command will create new services in your app, by default services are injected into root level.

Create route guards

ng generate guard auth-guard#where auth-guard is your guard name

Once you run this above command you will see three available guards and you need to choose which guard is required for you.

? Which interfaces would you like to implement?(Press <space> to select, <a> to toggle all, <i> to invert selection)❯◯ CanActivate ◯ CanActivateChild ◯ CanLoad

Create custom directives

ng generate directive emoji

This command will create a new custom directive called emoji in your app folder.

ng serve

This command is used to start the local development server so that you can develop your favorite app on your pc.

ng serve

ng test

This command is used to run the unit tests in a project.

ng test

ng e2e

This command is used to run the end to end tests in a project.

ng e2e

ng build

This command is used to build your app for production use.

ng build

Hope this code and post will helped you for implement Angular cli commands list. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US