Can a placeholder be set on the input to an ng table?
3 answers
You can edit ng-table.js
Unminify ng-table.js (i.e. http://jsbeautifier.org/ ) and after that on line 250 you can find
<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" ,class="input-filter form-control"/>
add a placeholder, i.e .:
<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" placeholder="input {{name}}",class="input-filter form-control"/>
See a working demo here:
+4
source to share
To avoid editing the ng-table.js file, you can add the following:
angular.module('ngTable').run(['$templateCache', function ($templateCache) {
$templateCache.put('ng-table/filters/text.html', '<input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" placeholder="{{name}}" class="input-filter form-control"/>');
}]);
This will create a cached copy of the template used in the text "ng-table" ng-tables "ng-table / filters / text.html".
+2
source to share