Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $rootScope.loading++;
  2.  
  3. profileInfo.$watch(function(newVal, oldVal) {
  4.  
  5. profileInfo.$loaded()
  6. .then(function(res) {
  7. $scope.user = res.profile;
  8. $scope.profileLoaded = true;
  9. })
  10. .catch(function(err) {
  11. setStatus(false, 'Unable to fetch profile', true);
  12. })
  13. .finally(function() {
  14. $rootScope.loading--;
  15. });
  16. });
  17.  
  18. profileInfo.$watch(function(newVal, oldVal) {
  19.  
  20. $rootScope.loading++;
  21.  
  22. profileInfo.$loaded()
  23. .then(function(res) {
  24. $scope.user = res.profile;
  25. $scope.profileLoaded = true;
  26. })
  27. .catch(function(err) {
  28. setStatus(false, 'Unable to fetch profile', true);
  29. })
  30. .finally(function() {
  31. $rootScope.loading--;
  32. });
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement