2016-12-31 97 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的解決方案。