The Angular way with options

You can also provide datatable options and datatable column options with the directive dt-options:

Note:

ID FirstName LastName
{{ person.id }} {{ person.firstName }} {{ person.lastName }}
ID FirstName LastName
{{ person.id }} {{ person.firstName }} {{ person.lastName }}
angular.module('showcase.angularWay.withOptions', ['datatables', 'ngResource']) .controller('AngularWayWithOptionsCtrl', AngularWayWithOptionsCtrl); function AngularWayWithOptionsCtrl($resource, DTOptionsBuilder, DTColumnDefBuilder) { var vm = this; vm.persons = []; vm.dtOptions = DTOptionsBuilder.newOptions().withPaginationType('full_numbers').withDisplayLength(2); vm.dtColumnDefs = [ DTColumnDefBuilder.newColumnDef(0), DTColumnDefBuilder.newColumnDef(1).notVisible(), DTColumnDefBuilder.newColumnDef(2).notSortable() ]; $resource('data.json').query().$promise.then(function(persons) { vm.persons = persons; }); }

data.json 

[{ "id": 860, "firstName": "Superman", "lastName": "Yoda" }, { "id": 870, "firstName": "Foo", "lastName": "Whateveryournameis" }, { "id": 590, "firstName": "Toto", "lastName": "Titi" }, { "id": 803, "firstName": "Luke", "lastName": "Kyle" }, ... ]