Installation of Angular CLI
Before installing Angular CLI, make sure you have node.js 6.9.0 version or above installed in your system. In case, you already have node.js installed, verify its version.
Angular CLI Installation is an easy task that can be completed in just one step. Run the following command and you will be authorized to use it:
$ npm install -g @angular/cli
Create a new Angular Application with CLI
ng new myproject
Once this command will run, it will take few minutes to automatically create a new directory called “node.js_module” with various files and required dependencies to scaffold and build the new Angular project.
Other commands to generate different parts of the Angular project
Here is a list of some commands that are used in various parts while developing an Angular project
ng serve - builds and bundles your Angular application automatically.
ng generate - create a new component, Directive, Services, Module, Class, Route etc.
ng lint- lint the app code i.e. improves the quality of the code and make it short.
ng test- enables to run KARMA test.
ng build- build new project files in a folder.
ng doc- opens official Angular API documentation
ng update- update Angular application to the latest version.