Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. function EditCtrl($scope, $state, Restangular, project) {
  2. var original = project;
  3. $scope.project = Restangular.copy(original);
  4.  
  5. console.log($scope);
  6. $scope.isClean = function() {
  7. return angular.equals(original, $scope.project);
  8. }
  9.  
  10. $scope.destroy = function() {
  11. original.remove().then(function() {
  12. $state.go('/');
  13. });
  14. };
  15.  
  16. $scope.save = function() {
  17. $scope.project.put().then(function() {
  18. $state.go('/');
  19. });
  20. };
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement