Created
January 17, 2016 22:20
-
-
Save miyamotodev123/1cc94ed71c106801ba32 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
(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