Skip to content

Instantly share code, notes, and snippets.

View esthervillars's full-sized avatar
😀

Esther Villars esthervillars

😀
  • Los Angeles, California
View GitHub Profile
@esthervillars
esthervillars / custom-submit.js
Created November 13, 2013 08:26 — forked from wladston/custom-submit.js
Angular JS custom submit directive
/**
* Custom submit directive that will only submit when all the validation has passed
* for all the fields. This extends on the ng-submit directive provided by AngularJS.
*
* This directive will also remove the 'pristine' flag from all the fields when
* hitting submit, allowing the form to display no errors until the submit button
* is clicked/enter is pressed.
*
* The variable 'app' is the instance of a module.
* E.g. var app = angular.module('my-app', []);