I recently developed an AngularJS directive where I included an ngIf directive in the template. Within this ngIf directive, there is an input element which is bound to the scope of my directive.
<div ng-if="bool"><input ng-model="foo"></div>
After conducting numerous tests, I discovered that the model was not being updated when the text in the input field was changed due to the presence of the ngIf directive. However, when I replaced it with ngShow, everything functioned as anticipated.
I am intrigued by the reasons behind this difference and would appreciate an explanation.
Feel free to check out the jsfiddle demonstration I created here