angular directive ignore non-numeric input

前端 未结 4 752
北荒
北荒 2020-11-30 06:37

I have to write some code for IE8. I have an ng-repeat creating a table filled with:



        
4条回答
  •  遥遥无期
    2020-11-30 07:19

    not directive but I use just:

    controller:

        $scope.blockNonNumber = function (val, field){
    
           $scope[field] = val.toString().replace(/[^0-9]/g, '');
    
        }
    

    html:

    
    

    it's not directive but can be used in directive as wellside

提交回复
热议问题