Skip to content

Instantly share code, notes, and snippets.

@jbmilgrom
Created June 21, 2015 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbmilgrom/b0d8b10f72bf343abf4b to your computer and use it in GitHub Desktop.
Save jbmilgrom/b0d8b10f72bf343abf4b to your computer and use it in GitHub Desktop.
.directive('nullifyModel', ['$filter',
function($filter){
return {
restrict: 'A',
require: "ngModel",
link: link
};
function link(scope, elem, attrs, ctrl){
ctrl.$parsers.push($filter('nullify'));
}
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment