Compare two fields in angularjs directive
I am trying to create directive which can be used to compare two fields in multiple projects. MarkUp : <div class="form-group"> <input ng-model="user.password" type="password" name="password" /> </div> <div class="form-group"> <input ng-model="user.confpassword" ng-compare="password" name="confpassword" type="password" /> <p ng-show="registrationform.password.$error.ngcompare" class="help-block">Password's don't match</p> Directive : "use strict"; angular.module('app.directive.ngCompare', []).directive('ngCompare', function () { return { require: 'ngModel', link: function (scope, element,