AngularJs搜索框过滤器无法使用翻译

时间:2017-01-16 09:31:02

标签: angularjs json search filter ui-select

以下搜索框可以完美找到下拉列表的原始代码:



   <ui-select ng-model="ctrl.selected" on-select="ctrl.refreshData()" theme="bootstrap">
	<ui-select-match placeholder="Select Profile"><span ng-bind="$select.selected.profile"></span></ui-select-match>
	<ui-select-choices repeat="data in ctrl.profile | filter:$select.search">
		<span ng-bind="data.profile | highlight: $select.search"></span>
	</ui-select-choices>
</ui-select>
&#13;
&#13;
&#13;

我将翻译添加到中文翻译代码后,搜索框对中文不起作用。只有英语正在运作。

&#13;
&#13;
 <ui-select ng-model="ctrl.selected" on-select="ctrl.refreshData()" theme="bootstrap">
  <ui-select-match placeholder="{{'translate.profile' | translate }}"><span translate="{{$select.selected.translateProfile}}" translate-default="{{$select.selected.profile}}"></span>
  </ui-select-match>
  <ui-select-choices repeat="data in ctrl.profile | filter:$select.search">
    <span ng-bind="( data.translateProfile | translate ) | highlight: $select.search"></span> 
  </ui-select-choices>
</ui-select>
&#13;
&#13;
&#13;

0 个答案:

没有答案