I'm using Angular and I have a button with an ng-disabled attribute that disables it until the user enters text in two text fields:
<input ng-model="name" type="text">
<input ng-model="password" type="password">
<input ng-disabled="name == '' || password == ''" type="submit" value="Log in" />
This works fine, however when the page first loads the button is enabled for a fraction of a second while angular loads and the browser processes the condition.
I want the button to be disabled from the instant the page loads and only enabled once the user enters text in those two fields.
Does anyone know if there is a solution to this?