-
Notifications
You must be signed in to change notification settings - Fork 12
AngularCLI
angular-cli is a wonderful CLI tool to generate Angular2 projects, components, and services, as well as administrative functions like starting a local server. The use of this project requires:
- installation of node.js.
- installation of angular-cli with:
npm install -g @angular/cli
.
After that you can begin exploring with the 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 follows the Angular2 recommendations and provides commands like ng serve
which starts your application with a server which supports Live Reloading (if you change your CSS or ts files in your Eclipse workspace, the browser is refreshed with your changes).
Angular2 IDE provides 3 means to consume angular-cli:
- with a Terminal which is integrated when you install Eclipse JEE Distribution.
- with Eclipse Wizards.
- with Eclipse Launches.
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.
Angular2 Eclipse provides an angular-cli.json
editor composed with 2 pages:
-
Overview Page
which provides a toolbar to run ng commands:
-
Source Page
which uses WTP JSON Editor and provides completion:
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: