title: Angularjs delete JSon object
body: <p>So I have little dilemma here. I have a nested json object that is inside ng-repeat and is sortable using <a href="https://github.com/angular-ui/ui-sortable" rel="nofollow">AngularJS UI Sortable</a> (based on JQuery UI Sortable): </p>
  
  <pre><code>$scope.rootItem = {
          id: '1',
          type: 'course',
          title: 'Adobe Photoshop CC for beginners',
          items: [{
              id: '2',
              type: 'label',
              title:'label',
              items:[{
                  id: '3',
                  type: 'module',
                  title:'Module title',
                  items: [{
                      id: '4',
                      type: 'topic',
                      title:'Topic title',
                      items: [{
                          id: '5',
                          type: 'content',
                          title:'Content title'
                      }, {
                          id: '6',
                          type: 'content',
                          title:'Content title'
                      }]
                  }]
              },{
                  id: '7',
                  type: 'resources',
                  title:'Resources'
              },{
                  id: '8',
                  type: 'module',
                  title:'Module title',
                  items: [{
                      id: '9',
                      type: 'topic',
                      title:'Topic',
                      items: [{
                          id: '10',
                          type: 'question',
                          title:'Question title'
                      }]
                  }, {
                      id: '11',
                      type: 'topic',
                      title:'Topic title',
                      items: [{
                          id: '12',
                          type: 'content',
                          title:'Content title'
                      }]
                  }]
              }]
          },{
              id: '14',
              type: 'assessmentLabel',
              title: 'Assessment Label',
              items: [{
                  id: '15',
                  type: 'assessment',
                  title: 'Assessment Title',
                  items: [{
                      id: '16',
                      type: 'courseAssessment',
                      title: 'Course Question Group',
                      items: []
                  }]
              }]
          }]
      };
  </code></pre>
  
  <p>What I should be able to do is remove any of the items within this object, and if it has any children they need to be remove too. </p>
  
  <p>So what I would generally think is passing either $index and use splice to remove it (if it was an array). </p>
  
  <p>But for objects doesnt seem to work this way, I read online that delete should be used instead... </p>
  
  <p>On my button I try to pass the object itself as in:</p>
  
  <pre><code>data-ng-click="removeItem(ngModelItem)"
  </code></pre>
  
  <p>and in my controller do something like this: </p>
  
  <pre><code>// Remove Item from the list
      $scope.removeItem = function(item) {
  
      };
  </code></pre>
  
  <p>Any suggestions? </p>