Hi all,
First time posting on this group (in any in fact) so I hope i'm not breaking any rules !
I'm trying to settup a project (small test project) with angular-ui-router. When I try and load the app I get:
[$injector:modulerr] Failed to instantiate module ui.router due to:
[$injector:nomod] Module 'ui.router' is not available! You either misspelled [...]
I'm using a layout very similar to the angular seed, here's my layout:
testapp/
app/
mainPage/
mainPage.html
mainPage.js
app.js
index.html
I put the ui-router in the package.json and it gets downloaded fine.
Here are my files:
app.js:
angular.module('testProject', [
'testProject.mainPage',
'ui.router'
])
.config(['$stateProvider', '$urlRouteProvider', function($stateProvider, $urlRouteProvider){
$urlRouterProvider.otherwise('/mainpage');
}]);
mainPage.js:angular.module('testProject.mainPage', ['ui.router'])
.config(['$stateProvider', '$urlRouterProvider',
function ($stateProvider, $urlRouterProvider){
$stateProvider.state('mainPage',{
url: '/mainpage',
templateUrl: 'mainPage/mainPage.html',
controller: 'mainPageController'
});
}])
.controller('mainPageController', [function(){
}]);
index.html:
<body>
<div ui-view></div>
<!-- Bootrap and angular included also -->
<scricp src="../node_modules/angular-ui-router/release/angular-ui-router.js"></script>
<script src="app.js"></script>
<script src="mainPage/mainPage.js"></script>
</body>
Tell me if you need more context or anything else.
Thanks
Sam