angular.js - How to silently perform copy operations on the page in angular?
某草草
某草草 2017-05-15 16:49:42
0
1
592

<input name="phone" ng-model="phone" type="text" />
<input name="code" ng-model="code" type="text" />
{{disabled = !(code && phone)}}
<button ng-class="{disabled:disabled}" type="button" >OK</button>

The above code can achieve the effect
But the result of {{disabled = !(code && phone)}} will be displayed
Put it in ng-if and it won’t be executed. I don’t want to put it in a hidden p

Is there any more elegant solution? For example, put it in a tag like ng-init

某草草
某草草

reply all(1)
黄舟

Isn’t there ng-disabled?

<button ng-disabled="!(code && phone)" type="button" >确定</button>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template