I have this very simple code. filterOption = 'Account ID' and the input appears when the value is right. But ng-model doesn't work and I dont see anything in the pre
<pre>{{test}}</pre> // doesnt work <pre> {{filterOption}}</pre> // this shows Account ID <input ng-if="filterOption == 'Account ID'" ng-model="test" required>
ng-ifcreates its own scope. Reach the controllers scope with$parent., so you would needng-model="$parent.test"$parentis a code smell, a symptom of a deeper problem.