Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Edit controller on $scope.project returning $promise in the object #4

Open
mstojanovv opened this issue Jun 1, 2015 · 0 comments
Open

Comments

@mstojanovv
Copy link

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

@mstojanovv mstojanovv changed the title Edit controller on $scope.project returning $promise in the array Edit controller on $scope.project returning $promise in the object Jun 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant