How to use angularjs ng-click with html5 datalist

前端 未结 3 1834
陌清茗
陌清茗 2021-01-18 05:52

I\'m working with AngularJS and i want to use the directive ng-click when an element of a datalist (html5) is selected.

Here is an example of my actual

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 06:33

    ng-click won't work on datalist options, as the click event (nor any of the keypress events) doesn't seem to be fired when using the datalist.

    You will have to use your ng-change on the function input and extend that to check if the current value is also present in the datalist.

提交回复
热议问题