Skip to content

Instantly share code, notes, and snippets.

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 miyamotodev123/1cc94ed71c106801ba32 to your computer and use it in GitHub Desktop.
Save miyamotodev123/1cc94ed71c106801ba32 to your computer and use it in GitHub Desktop.
(function() {
angular.module('app')
.controller('ProfileController', ['$http', '$scope', '$location',
function($http, $scope, $location) {
$http.get('/api/userData')
.success(function(response) {
console.log('user data success')
console.log(response)
$scope.user = response; //Expose the user data to your angular scope
})
.error(function(error) {
console.log('error user data error')
console.log(error)
$location.path(error.redirect);
});
}])
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment