How to make cascading Dropdown using Angularjs?

前端 未结 3 572
轮回少年
轮回少年 2021-01-22 01:11

Here i have Added list of mobile brand name with submodels. my expectation: 1.here nokia and samsung htc listed multiple times.how can i avoid same name repeated in list
2.w

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-22 01:52

    Add angular ui filter:

    angular.module('myApp', ['ui.filters'])
    

    First list shows distinct brands:

    ng-repeat="item in items | unique: 'brandname'"
    

    Second list filters by brand:

    ng-repeat="item in items | filter: {brandname: selectedBrand}"
    

    jsfiddle

提交回复
热议问题