AngularJS 2 installation in a window using CLI:
Angular CLI is the command line interface for AngularJS and fastest method to launch Angular 2 project.
1. First we need to install Node JS and npm (node package manager). As Angular2 uses Typescript (.ts file) so we need to run a compiler to convert them into .js, which can be done on-the-fly easily with Node.js and NPM. Download the Windows installer from the Nodes.js® web site and run the installer.
To check if node js and npm is installed properly in our machine, run this command:
It will return version of node js.
If npm is installed successfully it will also return npm version.
2. Then install Angular CLI using this command:
npm install -g angular-cli
It will take some time to install full package so keep patience.
3. Now create new project folder:
ng new testproject cd testproject ng serve
Here, testproject is the name of the project we are creating. The ng new command will create new project directory and also install all of the required library files to node_module directory of our project.
ng serve is similar to npm start which is used to run the angular2 project. We need to run this command every time when we make some changes in our code.
This screenshot display the file structure of the angular Js 2 project: