Trying to access $scope.mySlot.id but it is undefined.
$scope.removeMe = function(){
UserService.me().then(function(me){
$scope.ME = me;
});
var userToRemove = $scope.ME;
var shouldRemove = confirm('Remove you from this field trip?');
if (shouldRemove) {
var data = {
userID: userToRemove.id,
eventID: tripID,
}
console.log("data: " );
console.log(data);
$scope.mySlot = GreenTripFilledSlotsFactory.get(data);
console.log('this is $scope.mySlot: ')
console.log($scope.mySlot);
console.log('this is $scope.mySlot.id : ')
console.log($scope.mySlot.id);
console.log('this is $scope.mySlot.userID : ')
console.log($scope.mySlot.userID)
$scope.mySlot.$delete(function(success){
$route.reload();
})
}
}
In the console.logs $scope.mySlot is shown as a resource and it does list the values of it. But I'm confused why $scope.mySlot.id is undefined.
Here is the console:
via lightcollector7
No comments:
Post a Comment