Skip to content

Instantly share code, notes, and snippets.

@ohsiwon
ohsiwon / inputValidator.js
Last active June 3, 2016 18:38
AngularJs input validator directive for text, email and U.S. phone number
(function() {
'use strict';
function inputValidator($log) {
var vm, directive, inputType, regex;
function link(scope, element, attrs, ngModel) {
vm = scope;
function init() {