Skip to content

Instantly share code, notes, and snippets.

@Foxandxss
Forked from dchuk/gist:6151684
Created August 5, 2013 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Foxandxss/6156815 to your computer and use it in GitHub Desktop.
Save Foxandxss/6156815 to your computer and use it in GitHub Desktop.
serpIQ.factory('UserAccount', ['$resource', '$timeout', function($resource, $timeout) {
var userResource = $resource('/users/account', {}, {});
var accountInfo = {};
(function pollStatus() {
userResource.get({}, function(response){
accountInfo.foo = {
plan: response.plan,
limits: response.limits,
usage_remaining: response.usage_remaining,
feature_limits: response.feature_limits,
created_at: response.created_at
};
});
$timeout(pollStatus, 10000);
})();
return accountInfo;
}]);
app.controller('HeaderController', ['$scope', 'UserAccount', function($scope, UserAccount) {
$scope.userAccount = UserAccount;
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment