Skip to content
angelozerr edited this page Feb 18, 2017 · 7 revisions

Angular CLI

angular-cli is a wonderful CLI tooling to generate an Angular2 project, components, services, etc, start a server, etc. The use of this project requires:

  • installation of node.js.
  • installation of angular-cli with:

npm install -g @angular/cli.

ng commands

After that you can benefit with ng command (ex: ng new myproject to generate an Angular2 project)

It is recommended to use angular-cli when you wish to generate an Angular2 project, components, services, etc because it follow the whole Angular2 recommendations and provides command like ng serve which starts your application with a server which supports Live Reloading (if you change your CSS, ts files in your Eclipse workspace, the browser is refreshed with your changes).

Angular2 IDE provides 3 means to consume angular-cli:

Editors

Angular CLI configuration is done with:

  • angular-cli.json to customize Angular CLI.
  • .ember-cli to customize server (port of the server, live reloading port, etc).

Angular2 Eclipse provides an editor for those configuration files.

angular-cli.json

Angular2 Eclipse provides an angular-cli.json editor composed with 2 pages:

  • Overview Page which provides a toolbar to run ng commands:

Angular CLI Editor

  • Source Page which uses WTP JSON Editor and provides completion:

Angular CLI Editor

.ember-cli

By default, when server is started with ng serve, it uses 4200 port and Live Reloading is enabled. If you wish to customize port of the server, disable Live Reloading, etc, you can do that with .ember-cli file that you must create at hand in your project root. This file is a JSON file and Angular2 Eclipse provides support for this file with completion:

Ember CLI Editor

Clone this wiki locally