Javascript 角度js数据表ng单击不工作
我使用的是AngularJS数据表。目前我需要传递行ID。因此我尝试调用ng click函数。但它不起作用。请检查下面的代码Javascript 角度js数据表ng单击不工作,javascript,angularjs,datatable,angular-datatables,Javascript,Angularjs,Datatable,Angular Datatables,我使用的是AngularJS数据表。目前我需要传递行ID。因此我尝试调用ng click函数。但它不起作用。请检查下面的代码 $scope.dtOptions = DTOptionsBuilder.newOptions() .withOption('ajax', { dataType: 'json', contentType: "application/json; charset=utf-8",
$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()
];
如何使用此代码调用函数。谢谢函数passId应该在同一个控制器内,然后只有它能工作。请检查
$scope.passId= function () {
alert("hi")
};