CLI means “Command Line Interface”. It is a tool that automates the code setup for your applications from creating your configuration files to generation of different components for your application. To get started, go to www.github.com/angular/angular-cli

1

Note that installing Angular-CLI also requires updated Node 4.x.x and NPM 3.x.x versions. If you haven’t done it yet, refer to the tutorial on installation of Node and NPM.

In your terminal, type “npm install -g angular-cli”

2

Once it’s done loading, check if the installation is successful by typing “ng version”.

3

Once successfully installed, you may now use Angular CLI to create a saved project or archetype and for automated generations of different components such as directives, services or even routers for your application.

Angular-CLI is still in the development stage. In other words, Beta version. From time to time, you may need to update your Angular-CLI version. To do that just follow these commands:

4

To create a new Angular2 project using Angular-CLI, type this on your terminal:

5

– This will automatically generate your source files and configuration files
– It will also create the src folder containing your initial Angular2 components and HTML files.
– End-to-end folder or e2e folder is also created

6

And it’s ready to be run. Just clear your terminal and type “ng serve”

7

As you can see, it is running on port “localhost:4200”. Go to your browser and type it in the address bar and you’re done.

8

On the next article, we will be discussing Choosing your Preferred IDE.

 

 

JOIN THE ANGULAR ACADEMY!
$100,000 is the average annual salary of talented software developers and your chances of getting this salary get better by learning Angular 2 today!

Sign up now and make the first step towards upgrading your skill set.

PLUS: Get up to 75% OFF our Angular 2 course in Udemy!
We hate spam. Your email address will not be sold or shared with anyone else.