【发布时间】:2016-10-04 09:13:08
【问题描述】:
我试图将我的下拉框与另一个下拉框级联。所以第二个下拉框将列出与第一个下拉框中选择的项目相关的选项。我尝试了一个示例代码,然后下拉 - down 仍然是空的。
html:
<ion-view view-title="Car Type">
<ion-content ng-app="CarWash" ng-contorller="carBrand">
<h3> Add/Edit the Car Types </h3>
Make:
<select id="brand" ng-model="carBrand" ng-options="brand for (brand,item) in brandList">
<option value=''>Select</option>
</select>
Type:
<select id="makeType" ng-model="brandType" ng-options="item for (brand,item) in brandlist">
<option value=''>Select</option>
</select>
</ion-content>
</ion-view>
控制器:
[angular.module('CarWash',\[\]).controller('carBrand',\['$scope',function($scope){
$scope.brandList={'Benz':\['Regular','Truck'\]};
}\])]
链接1
【问题讨论】: