How to use angularjs ng-click with html5 datalist

前端 未结 3 1837
陌清茗
陌清茗 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:26

    
        
                
       
    
    • The name and ng-model are on the input .

      Data :

      states : [{name : "NJ" , country: "USA"} ,  {name : "NY" , country: "USA"} , 
               {name : "GA" , country: "USA"} ,   {name : "TX" , country: "USA"} , 
               {name : "CA" , country: "USA"} , 
               {name : "Delhi" , country: "India"} ,  {name : "Karnataka" , country: "India"} , 
               {name : "Hyderabad" , country: "India"} ,  {name : "West Bengal" , country: "India"} , 
               {name : "Zhejiang" , country : "China"} , {name : "Hubei" , country : "China"},
               {name : "LONDON" , country : "United Kingdom"} , {name : "MANCHESTER" , country : "United Kingdom"}] 
      

提交回复
热议问题