Created
June 21, 2015 13:45
-
-
Save jbmilgrom/b0d8b10f72bf343abf4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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