SHARE
TWEET
Untitled
a guest
Oct 4th, 2016
27
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- function yourDirective() {
- return {
- restrict: 'A',
- require: 'ngModel',
- link: function (scope, element, attrs, ngModelCtrl) {
- ngModelCtrl.$parsers.push(function (viewValue) {
- // code to parse the view
- return _requirement; // return the model
- });
- ngModelCtrl.$formatters.push(function (modelValue) {
- // code to format the model
- return _viewValue; // return the view
- });
- }
- };
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
