0
我想在選擇框中以升序顯示數據。angularjs動態的JSON數據排序
數據作爲下: -
[
{
"value": "MKZ_2017_LCN2014",
"text": "林肯MKZ"
},
{
"value": "MKX_2016_LCN2014",
"text": "林肯MKX"
},
{
"value": "MKC_presidential_LCN2014",
"text": "林肯總統系列MKC(Oasis)"
},
{
"value": "MKZ_2015_360used_LCN2014",
"text": "林肯MKZ(360)"
}
]
查看代碼: -
<select
class="select-modal"
ng-model="key3"
id="model-03-1"
name="third-primary-model"
ng-options="nameplate.text for nameplate in thirdLevelDropDown track by nameplate.value"
ng-change="getCarModel3(key3)"
>
<option value="">Select</option>
</select>
我想對文本的名稱進行排序選擇框。
感謝您的幫助
這是好的方式和角度的方式 –
@AniruddhaDas哪一個? – Sajeetharan