<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
Isn’t there ng-disabled?