You can also provide datatable options and datatable column options with the directive
dt-options:
Note:
- The options do not override what you define in your template. It will just append its properties.
- If you use the Angular way of rendering the table along with the Ajax or the promise solution, the latter will be display.
-
The Angular way is less efficient than fetching the data with the Ajax/promise solutions. The lack of
performance is due to the fact that Angular add the 2 way databinding to the data, which the ajax/promise solutions
does not. However, you can use Angular directive (
ng-click,ng-controller...) in there! -
Don't forget to set the properties
ngin the directivedatatableand thedt-rowsin order to tell the directive to use the Angular way! - It is NOT possible to add/edit/delete rows when using the angular way. Indeed, DataTables does not include the two-way-databinding natively. It renders only once and after you have to manually refresh your data. So this issue is quite challenging and it's not implemented (yet? Don't know if I'm planning to do it.) For now it's best that you use the datatable editor.
-
When using the angular way, you CANNOT use the
dt-columndirective. Indeed, the module will render the datatable after the promise is resolved. So for DataTables, it's like rendering a static table. If you need to provide some options to your columnn, your must provide thedt-column-defsdirective (which corresponds to the DataTables columnDefs).