【发布时间】:2018-04-04 13:08:54
【问题描述】:
Angularjs:搜索以 ! 开头时搜索过滤器不起作用(感叹号)
如果我的数据类似于 name='Anand!'
客户端过滤器应该与 searchWord='!' 一起使用
如果有人有同样的解决方案,请给我同样的解决方案。
提前致谢!!
我的代码:
<input type="search" class="form-control" ng-model="searchtext"
placeholder="search here..." />
<div ng-repeat="cust in customers |orderBy:'id' | filter:searchtext">
</div>
$scope.customers = [{
"id": 1,
"first_name": "Anand!",
"last_name": "GK",
"gender": "Male"
}, {
"id": 2,
"first_name": "ABC !",
"last_name": "XYZ",
"gender": "Female"
}];
【问题讨论】:
-
如果您需要帮助,请发布您的代码
-
现在有示例代码。
-
创建自定义过滤器
-
我们需要一些全局解决方案,比如指令。