Getting started with Angular
My friends at Equal Experts did this very nice example of how to get started with Angular.js. It involves a shopping cart and even a REST API to access the products “database”. Thanks to Anita Kadam @anitakadam11 and Pradib Hudekar @hpradip for a wonderful session on Angular.js. Here are the steps.
1. Install nvm
, the Node Version Manager
The simplest way to install nvm
is to download and run the install.sh
script of nvm
, like this:
1 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
or if you prefer wget
over curl
:
1 wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
More information: https://github.com/creationix/nvm
2. Use nvm
to install node.js (node
and npm
)
You can do it like this:
1 nvm install node
This installs node.js (node
and npm
) in your home directory.
3. Clone the nice ShoppingCart
project from Anita Kadam
1 git clone https://github.com/anitakadam/ShoppingCart
2 cd ShoppingCart
Note: Even if you already cloned, several of the subsequent commands require the project to be the current working directory.
Therefore in any case cd ShoppingCart
.
4. Use npm
to install bower
1 npm install -g bower
5. Use bower
to install the required libraries, including Angular.js
1 bower install
6. Use npm
to install required node packages
1 npm install
7. Use npm
to run the project
1 npm start
8. Open your browser and connect to http://localhost:3000
9. Enjoy
10. All commands in one sequence
1 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
2 wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
3 nvm install node
4 git clone https://github.com/anitakadam/ShoppingCart
5 cd ShoppingCart
6 npm install -g bower
7 bower install
8 npm install
9 npm start