我正在尝试将我的下拉框与另一个下拉框级联。因此,第二个下拉框将列出与第一个下拉框中所选项目相关的选项。我尝试了一个示例代码,但下拉框仍然为空。
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
发布于 2016-10-04 17:29:26
你能做到的,
<select name="client" ng-model="selectedRequest.parentType" ng-options="c.name.en for c in clients.brandList" required></select>
<select id="department" ng-model="selectedRequest.subType" ng-options="d.name.en for d in selectedRequest.parentType.children">https://stackoverflow.com/questions/39848442
复制相似问题