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"> 

angular doc


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -