How to make cascading Dropdown using Angularjs?

前端 未结 3 568
轮回少年
轮回少年 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 02:15

    With modified data model it will be easy deal with duplicate records

    { 
       brandName :
       {
         modelName:"", id: ""
       }
     }
    

    e.g

    {
        Nokia:[{
            id: "986745",
            modelname: "Lumia 735"
        },
        {
            id: "986746",
            modelname: "X 2"
        }]
    }
    

    Check out fiddle with the new data model here. Using this duplicates from the list are removed. For second dropdown you will have still have to handle click event from first dropdown.

提交回复
热议问题