So I have used ui-router in my web page. So far I have two views: list of users, and profile of the user.
I created following states:
.config(function($stateProvider, $urlRouterProvider) { // // For any unmatched url, redirect to /state1 $urlRouterProvider.otherwise("/home"); // // Now set up the states $stateProvider .state('home', { url: "/home", templateUrl: "index.html", controller: "View1Ctrl" }) .state('profile', { url: "/profile/:user", templateUrl: "profile/profile.html", controller: "ProfileCtrl", params : { user: null } }) }); My module includes:
angular.module('myApp', [ 'ngRoute', 'ui.bootstrap', 'ui.router', 'myApp.home', 'myApp.profile', ]) And the Controller which throws an error:
ngular.module('myApp.profile' ,['ngRoute', 'ui.bootstrap']) .controller('ProfileCtrl', function($stateProvider) { console.log($stateProvider.params); }); And this is the error:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.14/$injector/unpr?p0=<div ui-view="" class="ng-scope">tateProviderProvider%20%3C-%20%24stateProvider%20%3C-%20ProfileCtrl So: do you have any ideas where did I go wrong?