javascript - How to write the expression to disable an input text after entered a particular string -
now have this:
<input type="text" ng-model="cell.location">
what want while put 'abc' in field, field become disabled status, know can put boolean param control via controller.
however expect this:
<input type="text" ng-disabled="{{cell.location = 'abc'}}" ng-model="cell.location">
which clearer , simpler, unfortunately approach doesn't work expected, assign 'abc' field rather disable it. possible implement in kind of way?
thanks.
use ==
:
<input type="text" ng-disabled="cell.location == 'abc'" ng-model="cell.location" />
instead of:
<input type="text" ng-disabled="{{cell.location = 'abc'}}" ng-model="cell.location">