The $scope and Food variables are inaccessible within the destroy function.
foodProject.controller('FoodsCtrl', function($scope, Food) {
$scope.foods = Food.index();
$scope.destroy = function(food){
debugger;
console.log(Food, $scope);
food.$destroy();
};
});
Only the following local scope variables are available:
food: Resource
this: $get.e.$new.a
I cannot locate $scope and Food
http://jsfiddle.net/fW2EA/1/ http://jsfiddle.net/wizztjh/fW2EA/3/