text: /**
   * @ngdoc controller
   * @name Umbraco.Editors.ContentDeleteController
   * @function
   * 
   * @description
   * The controller for deleting content
   */
  function ContentDeleteController($scope, contentResource, treeService, navigationService, editorState, $location) {
  
      $scope.performDelete = function() {
  
          //mark it for deletion (used in the UI)
          $scope.currentNode.loading = true;
  
          contentResource.deleteById($scope.currentNode.id).then(function () {
              $scope.currentNode.loading = false;
  
              //get the root node before we remove it
              var rootNode = treeService.getTreeRoot($scope.currentNode);
  
              treeService.removeNode($scope.currentNode);
  
              if (rootNode) {
                  //ensure the recycle bin has child nodes now            
                  var recycleBin = treeService.getDescendantNode(rootNode, -20);
                  if (recycleBin) {
                      recycleBin.hasChildren = true;
                  }
              }
              
              //if the current edited item is the same one as we're deleting, we need to navigate elsewhere
              if (editorState.current && editorState.current.id == $scope.currentNode.id) {
                  $location.path("/content/content/edit/" + $scope.currentNode.parentId);
              }
  
              navigationService.hideMenu();
          });
  
      };
  
      $scope.cancel = function() {
          navigationService.hideDialog();
      };
  }
  
  angular.module("umbraco").controller("Umbraco.Editors.Content.DeleteController", ContentDeleteController);
  