角UI选择二在引导导航栏 [英] Angular UI Select2 in the Bootstrap Navigation Bar
本文介绍了角UI选择二在引导导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在引导导航栏中的角UI的选择二是给误差
Select2 of the Angular-UI in Bootstrap navigation bar is giving error
TypeError: Object [[object HTMLInputElement]] has no method 'is'
请参阅 http://plnkr.co/edit/yCG5M9
推荐答案
您需要AngularJS之前装载的jQuery
You need to load jQuery before AngularJS
只要改变以
<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>
修改(blesh):这是因为如果角度没有看到JQuery的,因为它的加载,那么 tElm
(角元素)的说法被传递到了编译
函数是一个jqLite对象。如果角度看到的JQuery已加载的第一个的,在 tElm
将是一个完整的jQuery对象,而是()
将可用。
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.
这篇关于角UI选择二在引导导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文