angularjsngtable

can a placeholder be set on the input in an ng-table?


Is there a way to set a placeholder on the <input> created in an ngTable?

As a second choice, is there another way to set an input to serve as the filter?

Changes to this would be appreciated. Thanks!


Solution

  • You can edit ng-table.js

    Unminify ng-table.js (ie: http://jsbeautifier.org/) and after that in line 250 you can find

    <input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" ,class="input-filter form-control"/>
    

    add placeholder there ie :

    <input type="text" ng-model="params.filter()[name]" ng-if="filter==\'text\'" placeholder="input {{name}}",class="input-filter form-control"/>
    

    Please see here for working demo :

    http://plnkr.co/edit/q0CMCb7evmZh1sflVV5f?p=preview