這是我嘗試過的代碼。我試圖用angularjs代碼和html代碼添加佔位符,但它不適用於這兩種情況。請幫助我,或建議我怎麼在這種情況下做佔位符未在angularjs中選擇select2
<select ui-select2="select2Options"
style="width:100%"
ng-model="SelectedProcessandIngredients"
data-placeholder="Select or Add Process/Ingredient"
ng-options="c.name group by c.status for c in colors"
ng-change="selectedinnerLoop()" >
</select>
角JS代碼:
$scope.select2Options = {
placeholder : "Select or Add Process/Ingredient",
formatResult : processList,
formatSelection : processList,
escapeMarkup : function (m) {
return m;
}
};
我認爲它適用於最新版本。 – maxisam
謝謝maxisam。 –