2016-03-09 34 views
0

我想要用的自举式的输入功能的下拉自举下拉和angular.js我怎么能整合与angular.js

inline

http://egemem.com/theme/kode/v1.1/form-elements.html

然而,它没有工作即使我试图用指令来避免使用jQuery

冲突的

我怎么能整合jQuery的功能与angular.js

HTML

{ “路线”: “路线”}

JS

app.directive('customepicker 
customepicker',function(){ 
    return { 
     restrict: 'CE', 
     replace: true, 
     template: '<select class="selectpicker" data-live-search="true" style="display: none;"> <option ng-repeat=" (departure, destinations) in routes">{{departure}}</option></select>', 
    }; 
}); 

输出

inline

回答

0

使用Angular-UI

这是引导适于用与Angular。

此存储库包含一组基于 Bootstrap标记和CSS的原生AngularJS指令。因此,不需要依赖于jQuery或 Bootstrap的JavaScript是必需的。

这里是using dropdowns部分:

下拉是一个简单的指令,它会切换上 点击或编程的下拉菜单。

这个指令由三个部分组成:

uib-dropdown which transforms a node into a dropdown. 
uib-dropdown-toggle which allows the dropdown to be toggled via click. This directive is optional. 
uib-dropdown-menu which transforms a node into the popup menu. 

这些部分的每需要被用作属性指令。

+0

看来Angular不能很好地与流行的第三方js插件集成,比如bootstrap,jqeury,backbone。 gotcha ~~~谢谢 – user3675188