title: Model does not update within ng-if
body: <p>I've got a strange behavior in an angular application and I don't know if that's a bug or a known limitation:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>'use strict';
  
  var ctrl = function ($scope) {
      $scope.foo = false;
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"&gt;&lt;/script&gt;
  &lt;div ng-app ng-controller="ctrl"&gt;
    foo: {{foo}}
    &lt;div ng-if="foo" style="background-color: #f00;"&gt;
      &lt;p&gt;foo&lt;/p&gt;
    &lt;/div&gt;
    &lt;div ng-if="!foo"&gt;
      &lt;br/&gt;&lt;button ng-click="foo = true;"&gt;Show foo&lt;/button&gt;
    &lt;/div&gt;
    &lt;button ng-click="foo = true"&gt;Show foo&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/78R52/" rel="noreferrer">http://jsfiddle.net/78R52/</a></p>
  
  <p>I would expect that clicking one of the buttons would set <code>foo = true</code>, but clicking the first button (within the <code>ng-if="!foo"</code>) doesn't change the model.</p>
  
  <p>Tested version is <code>1.2.1</code>.</p>