I have the following code :
<div ng-controller="myCtrl">
<div ng-if="myVar">
<input ng-model="query">
</div>
</div>
where myVar
is true
- When the
<input>
is within theng-if
thequery
variable isn't created in the$scope
. - When it's outside the div (but still within the
ng-controller
) it works well.
Any idea why ?!