2016-10-04 7 views
0

私のドロップダウンボックスを別のドロップダウンでカスケードしようとしています。その2番目のドロップダウンには、最初のドロップダウンボックスで選択したアイテムに関連するオプションがリストされます。サンプルコード、およびドロップダウンは空のままです。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

答えて

0

<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"> 

WORKING DEMO

+0

他のクエリでは、これを使用して機能を追加したり削除したりすることができます。 – sree

+0

はいあなたはそれを行うことができます – Sajeetharan

+0

@Sajeetharan – sree

関連する問題