withButtons is not a function
See original GitHub issueHi there
I started working with the buttons plugin but I can’t seem to make it work even after including almost all the files inside the plugins folder. Below are the files that I’ve imported into my page:
<script src="/bower_components/datatables.net/js/jquery.dataTables.min.js"></script> <script src="/bower_components/datatables.net-buttons/js/dataTables.buttons.min.js"></script> <script src="/bower_components/angular-datatables/dist/angular-dataTables.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/buttons/angular-datatables.buttons.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/colvis/angular-datatables.colvis.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/colreorder/angular-datatables.colreorder.min.js"></script> <script src="/bower_components/angular-datatables/dist/plugins/columnfilter/angular-datatables.columnfilter.min.js"></script>
And below is how I used it in my app.js:
$scope.dtOptions = DTOptionsBuilder.newOptions().withButtons(['pdf']);
But whenever I refresh my screen, I get the following error:
angular.js:13920 TypeError: DTOptionsBuilder.newOptions(...).withButtons is not a function
Below are the versions of each component: “angular-datatables”: “~0.5.4”, “datatables.net”: “~1.10.12”, “datatables.net-buttons”: “~1.2.2”
I would greatly appreciate any help!
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top GitHub Comments
Closing this issue as it was more of a coding error. Missed adding datatables.buttons in my angular app
how u added the datables.buttons in your angular app ,iam trying to adding it shows error var controllerId = ‘YearlyReportsDashBoard’; angular .module(‘IOCApp’) .controller(controllerId, YearlyReportsDashBoard);
Above code is for that.