angularjs - How to disable ng-model dynamically -


i'm using ng-model in input tag, such

<input ng-model="somemodel" type="file" />

at point in execution i'm interested in disabling/removing ng-model input won't affected anymore changes somemodel.

i've tried select input element , apply element.removeattr("ng-model") element still seems reacting changes somemodel.

my guess happening due digest cycle. how disable/remove ng-model?

have 2 inputs ng-if condition. ng-if can remove element dom.

<input ng-model="somemodel" type="file" ng-if="condition1" /> <input ng-model="" type="file" ng-if="!condition1" /> 

Comments