2016-12-31 95 views
2

我有一个多语言角应用程序,并且其中一种语言具有特殊字符,例如变音符号。它们在标签,标题,标题上显示得很好,但不能显示在占位符文本中。 这里是我的代码有:angularjs应用程序不会在UI选择字段中的占位符文本中显示特殊字符

<label translate="app.title"></label> 
<ui-select name="myoption" ng-model="app.option" theme="selectize"> 
    <ui-select-match placeholder="{{ 'app.placeholder' | translate }}"> 
     {{$select.selected.value}} 
    </ui-select-match> 
    <ui-select-choices repeat="o.key as o in tras.app.options | filter: $select.search"> 
     <div ng-bind-html="o.value | highlight: $select.search"></div> 
    </ui-select-choices> 
</ui-select> 

标识名称有特殊字符像äö正被显示的罚款。但同样的字也在占位符文本中,但它显示为&#228。 为什么它表现得像这样?有人可以帮助解决它吗?

+0

它可能与此问题有关:http://stackoverflow.com/questions/21097513/how-to-output-html-unicode-characters-from-an-expression? –

回答

1

使用ng-bind-html为标记,象这样:

<ui-select-match placeholder="{{ 'app.placeholder' | translate }}" 
       ng-bind-html="selected.selected.value"> 
</ui-select-match> 

但对于占位你”上面将不得不采用AHC的解决方案。