0
因此,我使用filter在我的應用程序中使用。在翻譯的句子上應用Angular-JS過濾器
以這種方式,我有幾個映射令牌的JSON。喜歡的東西:
{
TOKEN_1 : word,
TOKEN_2 : Something Cool!
}
現在我正在做一個表中巫婆我想有一個文本過濾器,當用戶填寫輸入和我告訴他所有的信息,其中這是寫該字符串顯示。
爲此,我使用documentation的filter:searchText
。 問題是我的過濾器應用於JSON而不是其位置映射。
總結:我想搜索 「一些很酷的東西」,但我的過濾器只顯示的東西,如果我搜索 「TOKEN_2」
我的HTML:
<div class="section-head">
<input type="text" id="filter" ng-model="searchText" />
</div><!-- /.section-head -->
<div class="section-body">
<div ng-repeat="lot in lotList | filter:searchText>
{{lot.status | translate}}
</div>
</div>
我按Ctrl
app.controller('Ctrl',function Ctrl($scope){
$scope.searchText = "";
});
任何想法?謝謝!
請添加一些相關的代碼。 –
@Michelem編輯了一些代碼 –