Last active
August 19, 2016 17:39
-
-
Save umdstu/64911f4d7a957673afafb0d7b2c63702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CoolService.getCool($scope.id).then(function(resp) { | |
$scope.cool = resp.powerLevel || 9000; | |
$scope.lame = resp.coolLevel || 9; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var service = {} | |
service.getCool = function(id) { | |
if (localStorage.get('cool_kid_' + id)) { | |
return localStorage.get('cool_kid_' + id); | |
else { | |
return $http.get(/cool_guys/' + id).then(function(resp) { | |
localStorage.set('cool_kid_' + id, resp); | |
return angular.fromJson(resp); | |
}); | |
} | |
}); | |
service.getCoolCac = function(id) { | |
return $http.get(/cool_guys/' + id).then(function(resp) { | |
return angular.fromJson(resp); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment