How to use jQuery Select2 with AngularJS

前端 未结 4 1674
醉酒成梦
醉酒成梦 2021-01-18 15:47

I am trying to use jQuery (2.2.1) Select2 (3.5.2) with Angularjs (1.5) but am having a difficult time grabbing the data from the select box. I have tried ui-select and I co

4条回答
  •  自闭症患者
    2021-01-18 16:15

    Install via bower "angular-ui-select": "=0.12.1" Then in your html.....

    
                {{$item.name}}
                
                    

    Never initialize jQuery plugins directly. Search over internet how to integrate jQuery modules with Angular (it might look bit complicated but it's quite easy. Calling it in the way You did will never works....

    
    

    Alternative for ui-select is:

    angular-chosen ("angular-chosen-localytics": "~1.0.7",)
    

    :)

提交回复
热议问题