AngularJS从输入重复过滤

时间:2016-12-19 10:28:50

标签: javascript html angularjs

我有问题。我有这个代码,但它不起作用的原因?它适用于其他项目。我有一个表,并用输入字段过滤它。

<md-content class="md-padding">
    <br>
    <md-input-container>
        <label>search</label>
        <input ng-model="searchCManager" placeholder='lss_user_id'>
    </md-input-container>
    <table class='table'>
        <thead>
        <tr class='header'>
            <td>user_id</td>
            <td>start_number</td>
            <td>lss_user_id</td>
            <td>agency_number</td>
            <td>business_unit_number</td>
            <td>office_id</td>
            <td>corporate_id</td>
            <td>asw_id</td>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="x in terminalOverview | filter:searchCManager " ng-class="{'noTerminal': x.terminals.length == '0' || x.terminals.length == 'terminal'}">
            <td>{{ x.user_id }}</td>
            <td>{{ x.start_number }}</td>
            <td>{{ x.lss_user_id }}</td>
            <td>{{ x.agency_number }}</td>
            <td>{{ x.business_unit_number }}</td>
            <td>{{ x.office_id }}</td>
            <td>{{ x.corporate_id }}</td>
            <td>{{ x.asw_id }}</td>
        </tr>
        </tbody>
    </table>
</md-content>

1 个答案:

答案 0 :(得分:0)

如果您想根据<input ng-model="searchCManager.user_id" placeholder='lss_user_id'> 进行过滤,请尝试使用

{{1}}