angular js数据表ng点击不工作



我使用的是Angular js数据表。目前我需要传递行ID。因此,我正在尝试调用ng-click函数。但它不起作用。请检查以下代码

$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', {
dataType: 'json',
contentType: "application/json; charset=utf-8",
url: appConfig.apiUrl + "/approvalList?reqTraceId=" + $scope.requestApprovalId,
xhrFields: { withCredentials: true },
type: 'POST',
data: function (d) {
return JSON.stringify(d);
},
error: function (response) {
ajaxErrorHandler.handle(response);
}
})
.withDataProp('data')
.withOption('processing', true)
.withOption('serverSide', true)
.withOption('scrollY', '400px')
.withOption('scrollX', '100%')
.withOption('scrollCollapse', true)
.withOption('drawCallback', function (settings) {
});
$scope.dtColumns = [
DTColumnBuilder.newColumn('traceId').withTitle('Trace ID').withClass('cus-id'),
DTColumnBuilder.newColumn('approval.0.usr').withTitle('Name').withClass('cus-id'),
DTColumnBuilder.newColumn('approval.0.threshold').withTitle('Match Strength %').withClass('cus-id'),
DTColumnBuilder.newColumn('traceId').withTitle('Action').renderWith(function (data, type, full) {
return '<div class="btn-group-xs">' +
'  <button type="button" class="btn btn-flat btn-xs btn-success" ng-click="passId();">' +
'    <i class="ion ion-eye"></i>' +
'  </button>' +
'</div>';
}).withClass('text-center').notSortable()
];

我使用以下函数进行测试。但Function没有调用。

$scope.passId= function () {
alert("hi")
};

如何使用此代码调用函数。感谢

函数passId应该在同一个控制器内,然后只有它才能工作,请检查。

最新更新