by Samarth Sinha on 2017-06-17 00:41:38
To start working with Angular 2, you need to get the following key components installed.
Npm − This is known as the node package manager that is used to work with the open source repositories. Angular JS as a framework has dependencies on other components. And npm can be used to download these dependencies and attach them to your project.
Git − This is the source code software that can be used to get the sample application from the github angular site.
For Linux system run the following commands to setup angular2 project.
sudo apt-get update sudo apt-get install git //git may be in your system by default. git --version //to check git version sudo apt-get install npm //npm may be in your system by default. npm -v //to check npm version sudo npm install nodejs node -v //to check nodejs version //If you have older version of npm and nodejs install new one by running the below commands
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs//It will install the nodejs version 6.11 and also update npm to version 3.10 git clone https://github.com/angular/quickstart myapp //It will craete a myapp folder which will have all the angular2 default files. cd myapp npm install //It will install all the nodejs dependencies in your project
Your Angular 2 application is now installed in your myapp folder. Now for running the application execute the following command:
Now open http://localhost:3000 on your browser and see your application.