challenges: switch from ngRoute to ui-router

This commit is contained in:
Tyler Renelle
2013-10-27 22:27:07 -07:00
parent f178eb2322
commit 35c4a62de0
23 changed files with 614 additions and 708 deletions

View File

@@ -3,8 +3,8 @@
/* Make user and settings available for everyone through root scope.
*/
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http',
function($scope, $rootScope, $location, User, $http) {
habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$http', '$state', '$stateParams',
function($scope, $rootScope, $location, User, $http, $state, $stateParams) {
$rootScope.modals = {};
$rootScope.modals.achievements = {};
$rootScope.User = User;
@@ -12,6 +12,10 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
$rootScope.settings = User.settings;
$rootScope.flash = {errors: [], warnings: []};
// Angular UI Router
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
// indexOf helper
$scope.indexOf = function(haystack, needle){
return ~haystack.indexOf(needle);