Tech Junkie Blog: AngularJS SPA : Setting Up Angular-Seed

Thursday, July 2, 2015

AngularJS SPA : Setting Up Angular-Seed

angular-seed is an AngularJS application skeleton template.  An application skeleton let's gives you a boiler plate template so that you don't have to start the application from scratch.  You can get the source code from  Below are the steps to use angular-seed ass your application template for AngularJS.

Step-By-Step Instructions:

1.  Go the page

2. Open Git GUI.  if you don't have Git install you can follow this blog.

3.  In the Github angular-seed page copy the "HTTPS clone URL"

4.  In Git GUI click on the link "Clone Existing Repository"

5.  In "Source Location" paste the angular-seed clone URL ( that you've just copied, then on the "Target Directory" field type in or browse to the folder that you want to store the repository in on your local machine.  Then click "Clone".  Make sure the "shoppingSPA" folder does not exist.  You can name your folder anything you want.

6.  Click on "Expore Working Copy" to see the repository on your local machine

7.  As you can see the repository has been cloned in your local PC

8.  Now we want to add npm NodeJs to the node package manager to run, debug, and package the AngularJS, follow this blog to setup NodeJs

9.  In the command line navigate to the angular-seed git in your local machine, then type "npm install" without the double quotes.  This process might take awhile, so don't cancel the process especially if it's the first time you run the command.

You will see something similar to the screen below

10. Now open up the bower.json file then add the bootstrap library to the list of dependencies, by typing in "bootstrap": "~4.1.1" the final markup should look like the following.  I've updated the bower.json file to the latest versions of each components.

  "name": "angular-seed",
  "description": "A starter project for AngularJS",
  "version": "0.0.0",
  "homepage": "",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "angular": "~1.7.2",
    "angular-route": "~1.7.2",
    "angular-loader": "~1.7.2",
    "angular-mocks": "~1.7.2",
    "html5-boilerplate": "^6.1.0",
    "bootstrap": "~4.1.1"

11.  Open the .bowerrc file and change the directory to "app/js/lib", the final markup should look like the following

  "directory": "app/js/lib"

Note: If you need more information on bower you can visit this blog that I wrote about it

Now type in the command bower install and the components in the bower.json file will be installed in the apps/js/lib folder

12.  After "npm install" command finish executing type in "npm start" in the command line to have nodejs start a local web server

12. Open up the index.html file in the app folder and replace all the instances of bower_components/ path with js/lib/

13.  In the browser type in the http://localhost:8000, you will see that angular-seed is hosted on the web server

No comments:

Post a Comment