做一件使用Twitter的引导与Angular.js时需要jQuery的? [英] Does one need jQuery when using Twitter Bootstrap with Angular.js?

查看:78
本文介绍了做一件使用Twitter的引导与Angular.js时需要jQuery的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是jQLite(与AngularJS建)足以Twitter的引导执行JavaScript的功能(比如下拉菜单)?

docs.angularjs 说:


  

从DOM操纵停止试图使用jQuery来修改DOM中
  控制器。真。这包括添加元素,删除元素,
  检索的内容,显示和隐藏它们。使用内置
  指令,或写自己在必要时,做你的DOM
  操纵。可以看看下面的复制功能。



解决方案

按照角UI Github上,没有。

 本地AngularJS(角)指令对Twitter的引导。占地面积小(5kB的gzip压缩!),没有第三方JS依赖(jQuery的,JS引导)需要!
http://angular-ui.github.io/bootstrap/

虽然牢记,这是专门为角UI做了一个包装,你可以/不可以能够轻松地使用他人已经使用此书面引导插件。

不过与默认角度UI&安培;引导副本那么你需要的jQuery在GitHub的库中的code已被大量修改,而不jQuery的工作。

正如评论指出 UI引导是一个非常好的选择,以及

Is the jQLite (in built with AngularJS) sufficient to execute javascript functionality (like dropdowns) in Twitter Bootstrap?

docs.angularjs says:

DOM Manipulation from Stop trying to use jQuery to modify the DOM in controllers. Really. That includes adding elements, removing elements, retrieving their contents, showing and hiding them. Use built-in directives, or write your own where necessary, to do your DOM manipulation. See below about duplicating functionality.

解决方案

According to the Angular UI Github, no.

Native AngularJS (Angular) directives for Twitter's Bootstrap. Small footprint (5kB gzipped!), no 3rd party JS dependencies (jQuery, bootstrap JS) required! 
http://angular-ui.github.io/bootstrap/

Though bear in mind this is a wrapper made specifically for Angular UI, you may/may not be able to easily use bootstrap plugins others have written with this.

However with a default Angular UI & copy of bootstrap then you'll need jQuery as the code in the github repository has been heavily modified to work without jQuery.

[Edit] As noted in the comments UI Bootstrap is a very good option as well.

这篇关于做一件使用Twitter的引导与Angular.js时需要jQuery的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆