app.controller('editController',function ($scope,people) { $scope.confirm = function () { people.modify($scope.editing,function (err) { $scope.closeThisDialog() }) $scope.editing = null } })