Web.Admin/AdminApp/Directives/directive.converttonumber.js
app.directive('convertToNumber', function () {
return {
require: 'ngModel',
link: function (scope, element, attrs, ngModel) {
ngModel.$parsers.push(function (val) {
return val ? parseInt(val, 10) : null;
});
ngModel.$formatters.push(function (val) {
return val ? '' + val : null;
});
}
};
});