mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
challenges: switch from ngRoute to ui-router
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user