yeoman - How to include ui.router in AngularJS project? -
yeoman - How to include ui.router in AngularJS project? -
i maintain getting error:
`error: [$injector:nomod] module 'ui.router' not available! either misspelled module name or forgot load it.
but pretty sure have configured correctly
the project created yeoman , uses bower manage dependencies, grunt build everything.
the yeoman angular generator created boilerplate basic ngrouter, installed ui.router with
bower install angular-ui-router --save
angular version
1.2.16
bower file
the above line updated bower.json file line in dependencies list:
"angular-ui-router": "~0.2.10"
app module set up
i updated app.js file adding dependency on ui.route (in add-on various other dependencies) angular.module('app', ['ngroute', ... 'ui.router'])
index.html
<!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> ... <script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script> <!-- endbower --> <!-- endbuild -->
i have above file in above directory, positive there (i copied , pasted path avoid typos). tried minified version no difference.
edit
i very, very new of (angular, bower, yeoman, etc) may doing wrong, no longer need include ui.router dependency? mean, has been integrated core angular framework somehow? ui.router deprecated?
i'm dumb. found reply this link. when running grunt
on cmd line, configured not build , check errors, run tests (using karma not understand yet).
so needed alter karma config file:
<project root>/test/karma.conf.js
below, indented line needed add:
// list of files / patterns load in browser files: [ 'bower_components/angular/angular.js', 'bower_components/angular-mocks/angular-mocks.js', 'bower_components/angular-animate/angular-animate.js', 'bower_components/angular-cookies/angular-cookies.js', 'bower_components/angular-resource/angular-resource.js', 'bower_components/angular-route/angular-route.js', 'bower_components/angular-sanitize/angular-sanitize.js', 'bower_components/angular-touch/angular-touch.js', 'bower_components/angular-ui-router/release/angular-ui-router.js', 'app/scripts/**/*.js', 'test/mock/**/*.js', 'test/spec/**/*.js' ],
angularjs yeoman angular-ui-router bower
Comments
Post a Comment