0
Im試圖級聯我的下拉框與另一個下拉菜單。因此,第二個下拉列表將列出與第一個下拉框中選擇的項目相關的選項。我嘗試過一個示例代碼,下拉菜單仍然是空的。使用angularjs級聯下拉菜單
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
和其他查詢將我能夠使用此添加和刪除功能。 – sree
是的,你可以做到 – Sajeetharan
你能分享樣本代碼@Sajeetharan – sree