Created
July 14, 2017 11:31
-
-
Save mahmut-gundogdu/0b9f23fa6dee21c98fee755a87a742fd to your computer and use it in GitHub Desktop.
Angular.Js de binding Type Değiştirmek get ve set de tür dönüşümü
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
function convertToNumber() { | |
return { | |
require: 'ngModel', | |
link: function (scope, element, attrs, ngModel) { | |
ngModel.$parsers.push(function (val) { | |
return parseInt(val, 10); | |
}); | |
ngModel.$formatters.push(function (val) { | |
return '' + val; | |
}); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment