Here is the directive:
<a ng-if="field.bindingType == 'options'">
<select ng-model="field.value" {{html}} >
<option ng-repeat="(k,v) in field.options" value="{{k}}">{{v}}</option>
</select>
</a>
<a ng-if="field.bindingType != 'options'">
<a ng-if="['text','ntext','nvarchar','varchar'].indexOf(field.type) > -1">
<textarea ng-model="field.value" {{html}} ></textarea>
</a>
<a ng-if="['double','float','int'].indexOf(field.type) > -1">
<input type="number" ng-model="field.value" {{html}} />
</a>
<a ng-if="field.type == 'bit'">
<input type="checkbox" ng-model="field.value" {{html}} />
</a>
<a ng-if="field.type == 'date'">
<input type="date" ng-model="field.value" {{html}} />
</a>
<a ng-if="field.type == 'time'">
<input type="time" ng-model="field.value" {{html}} />
</a>
<a ng-if="field.type == 'datetime'">
<input type="datetime-local" ng-model="field.value" {{html}} />
</a>
</a>
For some reason, when field.bindingType is 'options', and therefore passes the first ng-if, it can still pass the second ng-if (bindingType is NOT 'options'). Obviously, that's not possible, but it keeps happening.
This only happens when field. type matches one of the inner ng-if conditions, though. It's as if it is ignoring the ng-if="field.bindingType != 'options'" part of the directive.
What's the problem here?
Thanks.