title: ngShow and ngHide when in a ngRepeat loop, button to add element only first time it shows all the elements
body: <p>I have this issue: </p>
  
  <p>Inside a ngRepeat loop the form elements are hidden and only displayed when an edit button is clicked for each element.</p>
  
  <p>There is also a button at the end that adds an element to the list, and it should show the form for only the new empty elemnt added.</p>
  
  <p>When the add button is clicked first time, all the forms are displayed - it is clearly not intended -. But if I show the form elements and afterwards I hide them (submitting the form), when I click to the add button, it does not display all the forms, only the new one - what I actually intended -.</p>
  
  <p>The code is straightforward:</p>
  
  <pre><code>&lt;div ng-controller='TriggerCtrl' ng-model='triggers'&gt;
      &lt;ul&gt;
          &lt;li ng-repeat='trigger in triggers'&gt;
              &lt;span ng-hide='edit'&gt;{{trigger.operator}}&lt;/span&gt;
              &lt;button ng-click='edit=!edit' ng-hide='edit'&gt;Edit&lt;/button&gt;
              &lt;form name='editTrigger' ng-show='edit' ng-submit='submit'&gt;
                  &lt;select ng-model='trigger.operator' ng-options='op.value as op.name for op in operators' /&gt;
                  &lt;input id='submit' type='submit' value='Submit' ng-click='edit=!edit' /&gt;
              &lt;/form&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
      &lt;button ng-click='add()'&gt;Add&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the javascript:</p>
  
  <pre><code>function TriggerCtrl($scope) {
    $scope.triggers = [
      {operator: 'gt'}, 
      {operator: 'gte'}
    ];
  
    $scope.operators = [
      {name: 'greater than', value: 'gt'}, 
      {name: 'greater than equal', value: 'gte'}
    ];
  
    $scope.add = function () {
      $scope.triggers.push({});
      $scope.edit = true;
    };
  };
  </code></pre>
  
  <p>You can see the effect in jsfiddle <a href="http://jsfiddle.net/gserra/NG76R/1/" rel="nofollow">http://jsfiddle.net/gserra/NG76R/1/</a></p>
  
  <p>To test it, first click to add button and see that all forms are displayed. Then reload, and then first, click on edit and then click on submit. Afterwards, if you click in add button, only the new form will be displayed.</p>