2016-05-25 9 views
1

では、以下の画像のように表示され、Iはコードの下で試みたとき、UI-SELECT2プレースホルダangularjs

<input id="listcategories" type="hidden" data-placeholder= '{{model.placeholderText}}' data-ui-select2="{multiple: false, width:'100%'}" data-model="model" data-ng-model="model.value" data-ng-disabled="model.readOnly" /> 

をIはangularjsアプリケーションのUI-SELECT2を使用していると私は、動的プレースホルダテキストを使用します。

enter image description here

誰かが私はUI-SELECT2の動的プレースホルダを使用することを助けることができます。

ありがとうございます。

+0

、これを試すことができ、私は、あなたの必要性の入力タイプを隠すかの選択ドロップが –

+0

ダウンすることができます可能な重複:[リンク](http://stackoverflow.com/questions/22470089/rendering-a-dynamic-placeholder-with-angular)または[リンク](http://stackoverflow.com/questions/17286693/binding-ロード・イン・イン・オン・イン・オン・イン・オン・ロード(load-in-load-in-ie) –

答えて

0

HTMLページで使用このコードを

<script> 
    /*-- Select 2 Initialization --*/ 
    $("#listcategories").select2({placeholder: "Select a font"}); 
</script> 
0

あなたがhiので、デモを行ってください

<select id="listcategories" ng-options="item as item.label for item in items" ng-model="model"> 
<option value="">{{model.placeholderText}}</option> 
</select> 
関連する問題