Angular UI Select2 in the Bootstrap Navigation Bar

左心房为你撑大大i 提交于 2019-12-13 02:43:46

问题


Select2 of the Angular-UI in Bootstrap navigation bar is giving error

TypeError: Object [[object HTMLInputElement]] has no method 'is'

Please refer to the http://plnkr.co/edit/yCG5M9


回答1:


You need to load jQuery before AngularJS

Just change the order to

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>

EDIT (blesh): This is because if angular doesn't see JQuery as it's loading, then the tElm (angular element) argument being passed into that compile function is a jqLite object. If Angular sees JQuery has been loaded first, the tElm will be a full JQuery object, and is() will be available.



来源:https://stackoverflow.com/questions/13745124/angular-ui-select2-in-the-bootstrap-navigation-bar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!