Install the following things:
npm install -g grunt-cli bower yo generator-karma generator-angular
mkdir my-new-project && cd $_
yo angular [app-name]
- Answer a few questions
- Would you like to use Gulp instead of Grunt? N
- Would you like to use Sass with compass? N
- Would you like to include Bootstrap? N
- Which modules would you like to include?
- angular-animate
- angular-aria
- angular-cookies
- anuglar-resource
- angular-messages
- angular-route
- angular-santize
- angular-touch
- Overwrite package.json? overwrite
- Add bower components that are required from old bower.json to new bower.json
- Verify the libraries to be added from application.js / app.js file as well.
and
bower install
- Verify the libraries to be added from application.js / app.js file as well.
and
- Create/update application.js file
- Move the required routes, keep/remove modules as required.
- If using
$locationProvider.html5Mode(true);
then add this line toapp/index.html
file:<base href="/">
- Add required files (files from previous projects: controllers, directives, services, templates, images)
- controllers in
app/scripts/controllers
- templates in
app/views
- directives in
app/scripts/directives
- services in
app/scripts/services
- modules in
app/scripts/??
- images in
app/images
- controllers in
- Fix routes
- Run
grunt
initially, there will be some javascript errors that will have to be fixed for the app to build and run. Fix all possible errors and once successful, move on to the next step. If you are left with only warnings and it is safe to go ahead, then usegrunt --force
. grunt serve
== this is for local development only ==
For running on production, do the following:
- Add things
- Add things
- Add things