# With the DataTables Buttons

The `angular-datatables` also provides an API in order to make the plugin `Buttons` work with datatables.

You need to add the file `angular-datatables.buttons.min.js` to your HTML file.

You also need to add the dependency `datatables.buttons` to your Angular app.

See the API for the complete list of methods of the helper.

<tabset>

angular.module('showcase.withButtons', ['datatables', 'datatables.buttons']) .controller('WithButtonsCtrl', WithButtonsCtrl); function WithButtonsCtrl(DTOptionsBuilder, DTColumnBuilder) { var vm = this; vm.dtOptions = DTOptionsBuilder.fromSource('data.json') .withDOM('frtip') .withPaginationType('full_numbers') // Active Buttons extension .withButtons([ 'columnsToggle', 'colvis', 'copy', 'print', 'excel', { text: 'Some button', key: '1', action: function (e, dt, node, config) { alert('Button activated'); } } ]); vm.dtColumns = [ DTColumnBuilder.newColumn('id').withTitle('ID'), DTColumnBuilder.newColumn('firstName').withTitle('First name'), DTColumnBuilder.newColumn('lastName').withTitle('Last name') ]; }
</tabset>