Remove references to $rootScope.Shared & .Content in non-view code.

Instead, have them request services that return them so tests don’t need to prepare special state.
This commit is contained in:
Andrew Bloomgarden
2014-01-12 15:05:15 -08:00
parent 77801e458e
commit dc368bb652
14 changed files with 65 additions and 58 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
'use strict';
habitrpg.controller('NotificationCtrl',
['$scope', '$rootScope', 'User', 'Guide', 'Notification', function ($scope, $rootScope, User, Guide, Notification) {
['$scope', '$rootScope', 'Shared', 'User', 'Guide', 'Notification', function ($scope, $rootScope, Shared, User, Guide, Notification) {
$rootScope.$watch('user.stats.hp', function(after, before) {
if (after == before) return;
@@ -71,7 +71,7 @@ habitrpg.controller('NotificationCtrl',
$rootScope.$watch('user.items.pets', function(after, before){
if(_.size(after) === _.size(before) ||
$rootScope.Shared.countPets(null, after) < 90) return;
Shared.countPets(null, after) < 90) return;
User.user.achievements.beastMaster = true;
$rootScope.modals.achievements.beastMaster = true;
}, true);