AngularJS Form Validation - Disable Submit / Confirm Password Custom Directive
Creates a "UserValidation" module with validation directive to make sure passwords match.
http://thomporter.com
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css">
<div ng-app="">
<form name="myForm">
<label for="username">Username</label>
<input type="text" id="username" name="username" ng-model="formData.username" required />
<span ng-show="myForm.username.$error.required && myForm.username.$dirty">Required</span>
<label for="password">Password</label>
<input type="password" id="password" name="password" ng-model="formData.password" required />
<span ng-show="myForm.password.$error.required && myForm.password.$dirty">Required</span>
<br />
<button type="submit" class="btn" ng-disabled="myForm.$invalid">Submit</button>
</form>
</div>