在我后面的代码中,我填写了一个 DropDownList 如下(使用 VB)
ddlCountries.DataSource = dt ' dt is DataTable with columns "CountryCode" and "CountryName"
ddlCountries.DataTextField = "CountryName"
ddlCountries.DataValueField = "CountryCode"
ddlCountries.DataBind()
ddlCountries.Attributes.Add("ng-model", "CountryName")
然后是客户端,我有一个选择标签,其中填充了来自服务器端的选项,如下所示:
<select ng-model="CountryName">
<option value="IN">India</option>
<option value="US">United States</option>
<option value="ML">Malaysia</option>
<!-- and other 200+ records -->
</select>
我这里不能用ng-options!现在,每当我从 更改值时select,我都会得到CountryName、IN等US。ML此外,我无法编辑选项的值,因为它们在服务器端代码中使用。
在这里,我想要CountryNameas India,United States或者Malaysia相反!我能做些什么?