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 with your Angular CLI installation, go to www.github.com/angular/angular-cli
Note that the Angular CLI installation also requires updated NodeJS and NPM versions. If you haven’t done it yet, refer to the tutorial on installation of NodeJS and NPM.
In your terminal, type “npm install -g angular-cli”
Once it’s done loading, check if the installation is successful by typing “ng version”.
Once Angular CLI installation is successful, 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:
To create a new Angular project using Angular-CLI, type this on your terminal:
- This will automatically generate your source files and configuration files
- It will also create the src folder containing your initial Angular components and HTML files.
- End-to-end folder or e2e folder is also created
And it’s ready to be run. Just clear your terminal and type “ng serve”
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.