Angular CLI is Angular command line interface which simplifies common tasks when working with Angular 2+ applications
Unlike AngularJS setting up Angular 2+ application takes time since various files are required in any Angular 2+ application.These are files such as configuration files,type script files and css.For simplifying creation of these files Angular CLI could be used.Angular CLI is a command line interface used when working with Angular 2 applications.
Installing Angular CLI
You work with Angular applications using NPM which is Node package manager.You need to have node.js installed for working with NPM. You can install Node.js here.
Angular CLI is a command line interface to scaffold angular apps.It can generate the boilerplate code for your Angular application.
After you have installed Node.js you need to install angular cli using the following NPM command
npm install -g @angular/cli
Creating a new Angular application
Now you can create a new Angular boilerplate application using the new command as:
ng new "application name"
You pass the name of the application you want to create to the ng new command.After you execute the above command,application with “application name” will be created which includes all the boilerplate code such as configuration related code,routing etc.You can also run it.
Serving the application
To run the above application navigate to the folder where you created your application.
cd "application name"
start the application using the following command.
ng serve
Leave a Reply