Skip to content

Instantly share code, notes, and snippets.

@mahmut-gundogdu
Created July 14, 2017 11:31
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 mahmut-gundogdu/0b9f23fa6dee21c98fee755a87a742fd to your computer and use it in GitHub Desktop.
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ü
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