title: Add element in a ng-repeat both view and json object
body: <p>The issue is I have a ng-repeat which source is a json object.</p>
  
  <p>I have an "Add item" button which is supposed to add a new item to that json object and at the same time is rendered as one item more of the json object.</p>
  
  <p>But this item, since it's a new item which wasn't originally in the json object, has the chance to be removed before saving it as an element more of this json object.</p>
  
  <p>I'm not pretty sure if this is only a controller action or i should perform some action in a directive compile/link function to render the element or for other action.</p>
  
  <p><strong>The following code is just a reference about what I have in mind:</strong></p>
  
  <pre><code>    &lt;div ng-controller="MyCtrl"&gt;
          &lt;button ng-click="example.addItem()"&gt;&lt;/button&gt;
          &lt;div ng-repeat="item in example.jsonobject"&gt;
              &lt;p class="check-question"&gt;Question: {{item.question}}&lt;/p&gt;
              &lt;p class="check-explanatory"&gt;Explanatory: {{item.explanatory}}&lt;/p&gt;
  
              &lt;p ng-show="item.newItem === false" class="check-answer"&gt;Answer: {{item.answer}}&lt;/p&gt;
              &lt;input ng-show="item.newItem === true" class="check-answer" ng-model="item.answer"&gt;Answer: {{item.answer}}&lt;/input&gt;
              &lt;button ng-show="item.newItem === true" ng-click="example.removeItem()"&gt;&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>