One issue I am facing involves a piece of code that is only accessible inside of the 'then' function. I need to access it outside of this block in order to utilize it in other parts of my program.
$scope.model = {'first_name':'','last_name':'','email':'',};
djangoAuth.profile().then(function(data){
$scope.model = data;
console.log($scope.model); //this displays the retrieved data
});
console.log($scope.model); //this displays empty data
The code for the 'profile' function is as follows:
'profile': function(){
return this.request({
'method': "GET",
'url': "/user/"
});
}