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



-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to