Jquery 在行中设置控件时如何设置inputmask

Jquery 在行中设置控件时如何设置inputmask,jquery,angularjs,Jquery,Angularjs,我有一个创建行的角度表: <tr ng-repeat="rowContent in rows" class="gridRow"> <td> <input type="text" id="txtCompanyTitle" class="form-control" ng-model="CompanyTitle" /> </td> <td> <input type="text" i

我有一个创建行的角度表:

<tr ng-repeat="rowContent in rows" class="gridRow">
    <td>
        <input type="text" id="txtCompanyTitle" class="form-control" ng-model="CompanyTitle" />
    </td>
    <td>
        <input type="text" id="txtCompanyTaxes" class="form-control currencyMask" ng-model="CompanyTaxes" />
    </td>
    <td>
        <button type="button" ng-click="deleteRow(rowContent)" class="btn btn-danger btn-sm">
            <span class="glyphicon glyphicon-trash"></span>
        </button>
    </td>
<tr>

<button type="button" class="btn btn-default btn-sm" ng-click="addRow()">
    <span class="glyphicon glyphicon-plus"></span> Add
</button>
我确实在下面尝试了这个方法,但在创建下一行时,它只对当前行起作用(最后一行永远不会得到掩码):


var myApp=angular.module('myApp',[])
myApp.controller('companys',['$scope',function($scope){
$scope.rows=['Row 1'];
$scope.counter=2;
$scope.addRow=函数(){
$scope.rows.push('Row'+$scope.counter);
$scope.counter++;
$(“.currencyMask”).inputmask('货币'{
前缀:“”,
groupSeparator:“@Global.Mask_numberGroupSeparator”,
RadiExpoint:“@Global.Mask_numberradiExpoint”,
自动组:对
});
}
$scope.deleteRow=函数(项){
如果(确认(“@Global.Form\u AreYouSure”)){
变量索引=$scope.rows.indexOf(项);
$scope.rows.splice(索引,1);
}
}
}]);
谢谢Satpal

我确实在这里找到了这样做的指令:


最好为
currencyMask
$(".currencyMask").inputmask('currency', {
    prefix: '',
    groupSeparator: '@Global.Mask_NumberGroupSeparetor',
    radixPoint: '@Global.Mask_NumberRadixPoint',
    autoGroup: true
});
<script>
    var myApp = angular.module('MyApp', [])

    myApp.controller('Companies', ['$scope', function ($scope) {

        $scope.rows = ['Row 1'];
        $scope.counter = 2;

        $scope.addRow = function () {
            $scope.rows.push('Row ' + $scope.counter);
            $scope.counter++;
            $(".currencyMask").inputmask('currency', {
                prefix: '',
                groupSeparator: '@Global.Mask_NumberGroupSeparetor',
                radixPoint: '@Global.Mask_NumberRadixPoint',
                autoGroup: true
            });
        }

        $scope.deleteRow = function (item) {
            if (confirm("@Global.Form_AreYouSure")) {
                var index = $scope.rows.indexOf(item);
                $scope.rows.splice(index, 1);
            }
        }
    }]);
</script>