I've got a strange behavior in an angular application and I don't know if that's a bug or a known limitation:
I would expect that clicking one of the buttons would set foo = true
, but clicking the first button (within the ng-if="!foo"
) doesn't change the model.
Tested version is 1.2.1
.
ng-if
has its own scope, so you need to use:
<br/><button ng-click="$parent.foo = true;">Show foo</button>
Updated fiddle: http://jsfiddle.net/78R52/1/