AngularJS directive that fixes the issue where browsers autofill inputs and they aren't reflective in the model upon submit.
bower install autofill-directive
var myApp = angular.module('myApp', ['autofill-directive']);
Use the autofill-submit
directive on the form that you are submitting and provide the angular expression you want executed. Then place the autofill
directive on any inputs that may be autofilled by the browser. Now the model
will be updated to reflect what the browser has autofilled into the input BEFORE the submit expression is executed.
<form autofill-submit="login()">
<input autofill ng-model="username" placeholder="Username" type="text" />
<input autofill ng-model="password" placeholder="Password" type="password" />
<input type="submit" value="Login" />
</form>