Skip to content

Instantly share code, notes, and snippets.

@Bhavdip
Last active September 20, 2017 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bhavdip/4eaf8445283ee8ff064e112fbb894846 to your computer and use it in GitHub Desktop.
Save Bhavdip/4eaf8445283ee8ff064e112fbb894846 to your computer and use it in GitHub Desktop.
Angular CLI

For Angular4 need node_modules

  • This will add the node_modules into the existing angular project
npm install

  • For create a new component
ng generate component servers //<-- servers is component name>

or

ng g c servers //<-- servers is component name>
  • For create a new Directive
ng generate directive servers //<-- servers is directive name>

or

ng g directive servers //<-- servers is directive name>

You can create a component inside the other components

ng g c server/server --spec false // this will create a sub-component inside the parent component without spec.ts file

Another example of command line create the component

ng g c recipes/recipe-list --spec false
ng g c recipes/recipe-detail --spec false

install the bootstrap using npm

npm install --save bootstrap

It is called Decorator

@Component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment