2015-10-14 48 views
0

是我在地圖 形式JSON創建一個下拉{ 「區域1」:[ 「OFFICE1」, 「office2」 ] }使用此處NG-重演angularjs

我想創建2在angularjs中使用ng-repeat下拉,即在一個下拉菜單中顯示area1,在另一個下拉菜單中顯示office_1和office_2。但我無法實現this.can有人幫助

+0

那你試試? –

+0

給你試過代碼plunker –

+0

Select the area:
user3415447

回答

0

你可以做這樣的事情,其中​​型號爲您的辦公室的地圖JSON模式:

<body ng-controller="AppCtrl"> 
    <select id="repeatSelect" ng-model="selectedArea"> 
     <option ng-repeat="(key,prop) in model" value="{{key}}">{{key}}</option> 
    </select> 
    <select id="repeatSelect1" ng-model="selectedState"> 
     <option ng-repeat="state in model[selectedArea]" value="state">{{state}}</option> 
    </select> 
    </body> 
+0

謝謝,它的工作:) – user3415447

+0

你能幫助我在改變滴的大小down..i希望每個下拉菜單覆蓋整個屏幕寬度。@ curiousgeek – user3415447