Thanks! This is the better solution.

I'll try to add the ngPattern validator inside this directive



Il giorno martedì 24 novembre 2015 07:05:52 UTC+1, Sander Elias ha scritto:
>
> Hi Antonello,
>
> I figured a sample might help you.
>
> function toNum() {
>     return {
>         restrict: 'A',
>         require: 'ngModel',
>         link: function (scope, elem, attrs, ctrl) {
>             ctrl.$formatters.push(function (value) {
>                 return value ? parseFloat(value) : null;
>             });
>         }
>     };
>
>
> angular
>   .module('someModule',[])
>   .directive('toNum', toNum)
>
> Should be able to fix the number issue
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to