How to Get the Value Like First Drop Down Value Related to Another Drop Down Value using of Angular JS?

后端 未结 1 695
南旧
南旧 2020-12-22 12:09

How to get the value like first select drop down value related to another select drop down value using of angular js?

Hi all I have created two drop down field

相关标签:
1条回答
  • 2020-12-22 12:20
    <div>
      <p></p>
      <lable>Kp Users categories</lable>
       <select ng-model="filter.Filtercategorieskp"  ng-options="item.categories for item in users | filter:{roles: 'kp'}">
      </select>
    </div>  
    <div>
      <lable>Kp Users</lable>
       <select ng-model="Filterkp" ng-change="newClass=Filterkp.username"  ng-options="item.username for item in users | filter:{ categories: filter.Filtercategorieskp.categories, roles:['kp']}">
      </select>
    </div>
    

    Look at the HTML of Plunker's filter. it uses

    filter:{roles: 'kp'}
    

    and

    filter:{ categories: filter.Filtercategorieskp.categories, roles:['kp']
    

    But you use ilter:flterWithKp

    If you want to filter with controller's method, you have to write two methods for two filter or you can use as like plunker.

    I have update the plunker. You can check it:

    Working plunker

    0 讨论(0)
提交回复
热议问题