I'm new to angular, trying to use angular-datatables library http://l-lin.github.io/angular-datatables/#/angularWay, but don't know how to control the style of the table, cause they are all angular directives, is it possible I can touch the HTML elements inside? like the example below, how can I remove the text next to search box? Also I've read API, couldn't find how to hide the datatables_info on the buttom.
update
maybe I can hide them through CSS, but seems it's impossible to add placeholder to the input element
You can do this in various ways, also by manipulating the injected DOM elements - but the "correct" way would be to alter the language settings. The default language object literal is
Change
search
to""
and includelang
aslanguage
option :You can disable the table information summary completely by omitting the
i
flag from thedom
option. The defaultdom
setting islfrtip
, so simplySee both solutions in action here -> http://plnkr.co/edit/3WqPj1IW1h3zK37hF4dv?p=preview
The injected search box is located at
.dataTables_filter input
. You can useangular.element()
ordocument.querySelector()
to manipulate such DOM elements. To add a placeholder to the search boxThis is very tricky. The injected elements has nothing to do with angular - I believe it is somehow possible to add a
ng-click
to an element and then (re)$compile
. However, the pagination buttons is recreated each and every time the table is redrawn, so the angularification' would need to happen over and over. But you can easily facilitate events for the prev/next buttons without std angular directives :There is also a
page.dt
event, fired when the active page changes :