angular-seed — the seed for AngularJS apps
This project is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects.
The seed contains AngularJS libraries, test libraries and a bunch of scripts all preconfigured for instant web development gratification. Just clone the repo (or download the zip/tarball), start up our (or yours) webserver and you are ready to develop and test your application.
The seed app doesn't do much, just shows how to wire two controllers and views together. You can
check it out by opening app/index.html in your browser (might not work file
file:// scheme in
certain browsers, see note below).
Note: While angular is client-side-only technology and it's possible to create angular webapps that
don't require a backend server at all, we recommend hosting the project files using a local
webserver during development to avoid issues with security restrictions (sandbox) in browsers. The
sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr,
etc to function properly when an html page is opened via
file:// scheme instead of
How to use angular-seed
Clone the angular-seed repository and start hacking...
Running the app during development
You can pick one of these options:
- serve this repository with your webserver
- install node.js and run
Then navigate your browser to
http://localhost:<port>/app/index.html to see the app running in
Running the app in production
This really depends on how complex is your app and the overall infrastructure of your system, but
the general rule is that all you need in production are all the files under the
Everything else should be omitted.
Angular apps are really just a bunch of static html, css and js files that just need to be hosted somewhere, where they can be accessed by browsers.
If your Angular app is talking to the backend server via xhr or other means, you need to figure out what is the best way to host the static files to comply with the same origin policy if applicable. Usually this is done by hosting the files by the backend server or through reverse-proxying the backend server(s) and a webserver(s).
Running unit tests
Requires node.js, Karma (
sudo npm install -g karma) and a local
or remote browser.
- a browser will start and connect to the Karma server (Chrome is default browser, others can be captured by loading the same url as the one in Chrome or by changing the
End to end testing
We recommend using protractor for end-to-end tests. It uses native events and has special features for Angular applications.
Requires a webserver, node.js +
./scripts/web-server.js or your backend server that hosts the angular static files.
- create your end-to-end tests in
- serve your project directory with your http/backend server or node.js +
- to run:
- run the tests from console with Protractor via
CloudBees have provided a CI/deployment setup:
<a href="https://grandcentral.cloudbees.com/?CB_clickstart=https://raw.github.com/CloudBees-community/angular-js-clickstart/master/clickstart.json"><img src="https://d3ko533tu1ozfq.cloudfront.net/clickstart/deployInstantly.png"/></a>
If you run this, you will get a cloned version of this repo to start working on in a private git repo, along with a CI service (in Jenkins) hosted that will run unit and end to end tests in both Firefox and Chrome.
Receiving updates from upstream
When we upgrade angular-seed's repo with newer angular or testing library code, you can just fetch the changes and merge them into your project with git.
For more information on AngularJS please check out http://angularjs.org/