Edit controller on $scope.project returning $promise in the object
app.controller('EditCtrl',['$scope','$routeParams','$location','Project',function($scope,$routeParams,$location,Project){ var self = this; Project.get({id: $routeParams.id}, function(project) { console.log(project) self.original = project; $scope.project = new Project(self.original);
});
$scope.isClean = function() { return angular.equals(self.original, $scope.project); };
$scope.destroy = function() { self.original.destroy(function() { $location.path('/'); }); };
$scope.save = function() { $scope.project.update(function() { $location.path('/'); }); }; }]);
When i console.log(project) here is the output in the console :
{id: "6", name: "asd", site: "http://google.com", description: "asd", $promise: d…}$promise: d$$state: Object__proto__: Object$resolved: truedescription: "asd"id: "6"name: "asd"site: "http://google.com"
So when trying to update the database error occured, trying to update $promise column
How can i fix this problem ? Thanks