i want add excel, copy , pdf , print buttons in the angular js . but im getting error while showing buttons in the data table. data table is working fine but when i added button code the datatable is not working error
Uncaught Error: [$injector:modulerr]
styles and js references
<script src="~/angularjs/jquery.js"></script>
<script src="~/angularjs/jquery.dataTables.js"></script>
<script src="~/angularjs/angular.min.js"></script>
<script src="~/angularjs/angular-datatables.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.dataTables.min.css">
<script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.print.min.js"></script>
html
<div ng-app="MyApp" class="container">
<div ng-controller="homeCtrl">
<table id="entry-grid" datatable="" dt-options="dtOptions" dt-columns="dtColumns" class="table table-hover"></table>
</div>
</div>
code
var app = angular.module('MyApp', ['datatables']);
app.controller('homeCtrl', ['$scope', '$http', 'DTOptionsBuilder', 'DTColumnBuilder',
function ($scope, $http, DTOptionsBuilder, DTColumnBuilder) {
$scope.dtColumns = [
DTColumnBuilder.newColumn("timestamp", "Time"),
DTColumnBuilder.newColumn("dataFrame", "data Frame"),
DTColumnBuilder.newColumn("fcnt", "fcnt"),
DTColumnBuilder.newColumn("freq", "freq"),
DTColumnBuilder.newColumn("rssi", "rssi")
]
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', {
url: "/Manhole/GetManholeReadings",
type: "POST"
})
.withButtons([
'copy',
'pdf',
'excel'
])
.withPaginationType('full_numbers')
.withDisplayLength(10);
}])