Skip to content Skip to sidebar Skip to footer

Angular Datatable Ng-click Not Working

got a problem with ng-click on angular datatables. I'm using https://l-lin.github.io/angular-datatables Here is my code $scope.dtOptions = DTOptionsBuilder.fromFnPromise(functi

Solution 1:

 $scope.dtOptions = DTOptionsBuilder.fromFnPromise(function(){
        return $resource(APIROOT + 'categories').query().$promise;
    })
.withOption('createdRow', createdRow)
        .withOption('order', [0, "asc"]);
function createdRow(row, data, dataIndex) {
        // Recompiling so we can bind Angular directive to the DT
        $compile(angular.element(row).contents())($scope);
console.log("test");
    }
//now ur deleteItem function is complied and it'll work.
 $scope.deleteItem = function (id) {
        alert('delete')
    }

Post a Comment for "Angular Datatable Ng-click Not Working"