Is there a way to retrieve the $scope variable from an AngularJS success response in one function and use it in another?
$scope.mydoc = function() {
var params = {
tribe_id: $scope.parentCtrl.id
};
dealRoomApiService.getOfflineLoanDocs(params)
.then(function(resp) {
$scope.docList = resp.data;
}, function(error) {
toastr.error(error.data.detail); //Display a toast notification
});
}
In the above code, how can I access the $scope.docList
variable in the following function?
$scope.myDoc = function(doc, index) {
console.log("Test....",$scope.docList);
};