Use unobtrusive validator with AngularJs


Create a Directive called ‘validateit’ in Angularjs
and call ‘validateit’ directive in submit button.

PsAdminApp.directive('validateit', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.on("click", function (e) {
$('form').each(function () {
var $el = $(this);
$el.data('validator', null);

$.validator.unobtrusive.parse($el);
});
});
}}
});

Submit button code

<input type="submit" name="submit" value="submit" validateit />