Some useful commands to use with angular 2 cli

Hello Readers , Hope you all are doing good!!

In this Blog article i am showing some useful commands to use with angular 2 cli.

1)Create new component

Command: ng g c name of the component

Example: ng g c demo

component.png

Explanation: here ng stands for angular

g stands for generate

c stands for component

2) Create new component but not the directory (inside the directory  )

Command:ng g c name of the component –flat

Example:ng g c demo1 –flat

componentflat.png

Explanation: here ng stands for angular

g stands for generate

c stands for component

–flat will not create new directory

3)Create component with  inline css and inline html

Command:ng g c name of the component –flat -is -it

Example:ng g c demo1 –flat -is -it

componentis

inlinecomponent.png

Explanation: 

-is Inline Style

-it Inline template

4)Deleting Component

Command:ng destroy component name of the component

destroy.png

 

5)Create Service 

Command:ng g s data

service.png

Explanation: 

s stands for service

6) Create Class

Command: ng g cl name of class

Example : ng g cl demo

class.png

Explanation: 

cl stands for class

7)Create custom pipe

Command:ng g p name of pipe

Example : ng g p power

pipe.pngpipe1.png

Explanation: 

p stands for pipe

 

Advertisements

1 thought on “Some useful commands to use with angular 2 cli”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s