Docker: AngularJS

First install Node.js (Linux Mint / Ubuntu):

# Note the new setup script name for Node.js v0.12
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
 
# Then install with:
sudo apt-get install -y nodejs

The easiest way to create a full-featured Angular application is with Yeoman. Yeoman is a Node.js module (npm) and along with its Angular generator creates a project that includes all of the build and test tools you’ll need to maintain an application:

sudo npm install -g yo
sudo npm install -g generator-angular

Generate the Angular application with yo. Accepting all the defaults will include Bootstrap and some AngularJS recommended modules:

mkdir myapp
cd myapp
# Install grunt
# This will install the grunt-cli package into a system location guaranteed to be in the $PATH, 
# which turns around and looks for a package-specific grunt installed which is not system-wide
sudo npm install -g grunt-cli
sudo npm install grunt --save-dev
sudo npm install grunt-contrib-concat --save-dev
 
sudo yo angular myapp
 
### Optional run manually on any errors
# Check git
which git
 
# Install git if not exist
apt-get install git
 
npm install -g bower
 
bower install
# On permission error
sudo chown yourusername:yourusername PATH/bower-github.yml
 
sudo npm install
 
# Start the server with Grunt - which needs to be installed separately
grunt serve
 
# In case of an error
sudo npm install findup-sync -g
sudo npm link findup-sync

The application can be viewed in a browser at http://localhost:9000/#/:


Leave a Reply