2016-09-03 6 views
0

私はグループ化されたui-selectを作成しようとしています。実際、それぞれのui-selectオプションは以前のものに依存します。 たとえば、私は最初のUI選択のレベルのリストを持っています。そして、最初のui選択されたアイテムに応じて、場所番号のリストが2番目のui-selectに表示されます。 は可能ですか?ここ は私のコードですが、私はまだそれをimplemntすることができませんでした:(関連角度ui-select

<div class="SumoSelect sumo_somename" tabindex="0" style="width:80%"> 
     <ui-select search-enabled=false ng-model="levelNumber.selected" 
         theme="bootstrap" append-to-body="true" on-select="getListPlacePerLevel(levelNumber.selected)"> 
        <ui-select-match placeholder="">{{$select.selected.levelNumber}}</ui-select-match> 
        <ui-select-choices repeat="item in levels"> 
        <span ng-bind="item.levelNumber"></span> </ui-select-choices> </ui-select> 
    </div> 
    <div class="SumoSelect sumo_somename" tabindex="0" style="width:80%; margin-top:20px;"> 
     <ui-select search-enabled=false ng-model="item.selected" 
         theme="bootstrap" append-to-body="true"> 
        <ui-select-match placeholder="">{{$select.selected.item}}</ui-select-match> 
        <ui-select-choices repeat="item in levelNumber.selected.listPlaceNumber"> 
        <span ng-bind="item"></span> </ui-select-choices> </ui-select> 
    </div> 

と、このplunkがあなたのために働く場合

[{"levelNumber":1,"listPlaceNumber":[1,2,3,4,6]},{"levelNumber":2,"listPlaceNumber":[2,4,6,7]},{"levelNumber":3,"listPlaceNumber":[11,12,13,14,16]}] 

答えて

0

下記参照としての私のJSONデータは次のとおりです。

http://plnkr.co/edit/2kiQ7W?p=preview

関連するコード:

<div tabindex="0" style="width:80%"> 
    <ui-select search-enabled="false" ng-model="levelNumber.selected" theme="bootstrap" append-to-body="true" on-select="getListPlacePerLevel(levelNumber.selected)"> 
     <ui-select-match placeholder="">{{$select.selected.levelNumber}}</ui-select-match> 
     <ui-select-choices repeat="item in levels"> 
      <span ng-bind="item.levelNumber"></span> 
     </ui-select-choices> 
    </ui-select> 
</div> 
<div tabindex="0" style="width:80%; margin-top:20px;"> 
    <ui-select search-enabled="false" ng-model="item.selected" theme="bootstrap" append-to-body="true" on-select="getListPlacePerLevel($select.selected)"> 
     <ui-select-match placeholder="">{{$select.selected}}</ui-select-match> 
     <ui-select-choices repeat="item in levelNumber.selected.listPlaceNumber"> 
      <span ng-bind="item"></span> 
     </ui-select-choices> 
    </ui-select> 
</div> 
関連する問題