Angular how can I get selected options (multiple)

前端 未结 2 1117
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 21:41

I\'m literally looking for the solution to this problem for two days and I can\'t find a thing... Basically what I want is to get selected options from my

2条回答
  •  被撕碎了的回忆
    2020-12-11 22:20

    You should use [(ngModel)]

    
    
    clickedOption(){
        console.log(this.selectedCars)
      }
    

    You can simply log the elements when ever an option is clicked as shown in the above method

    LIVE DEMO

提交回复
热议问题