美文网首页我爱编程
Angular内嵌jqlite语法大全

Angular内嵌jqlite语法大全

作者: 玮哥今晚打老虎 | 来源:发表于2016-03-16 22:18 被阅读0次

AngularJS强化了前端的MVC逻辑,却弱化了Jquery的Dom操作能力。

好在Angular自身也考虑到这个问题,所以它自身内置了jqLite来弥补这方面的不足。

同时它提供了jqlite的封装方法:angular.element(ele),相当于jquery的$

但建议使用时可以在全局处设置

`var $ = function(ele){

if(typeof ele == "string"){

ele = document.querySelectorAll(ele);

}

return angular.element(ele);

};

但jqLite只有一部分Jquery的语法,很多小伙伴可能都找不到jqlite的API,所以我这里就列举一下

* jqLite provides only the following jQuery methods:

*

* – [`addClass()`](http://api.jquery.com/addClass/)

* – [`after()`](http://api.jquery.com/after/)

* – [`append()`](http://api.jquery.com/append/)

* – [`attr()`](http://api.jquery.com/attr/)

* – [`bind()`](http://api.jquery.com/on/) – Does not support namespaces, selectors or eventData

* – [`children()`](http://api.jquery.com/children/) – Does not support selectors

* – [`clone()`](http://api.jquery.com/clone/)

* – [`contents()`](http://api.jquery.com/contents/)

* – [`css()`](http://api.jquery.com/css/)

* – [`data()`](http://api.jquery.com/data/)

* – [`empty()`](http://api.jquery.com/empty/)

* – [`eq()`](http://api.jquery.com/eq/)

* – [`find()`](http://api.jquery.com/find/) – Limited to lookups by tag name

* – [`hasClass()`](http://api.jquery.com/hasClass/)

* – [`html()`](http://api.jquery.com/html/)

* – [`next()`](http://api.jquery.com/next/) – Does not support selectors

* – [`on()`](http://api.jquery.com/on/) – Does not support namespaces, selectors or eventData

* – [`off()`](http://api.jquery.com/off/) – Does not support namespaces or selectors

* – [`one()`](http://api.jquery.com/one/) – Does not support namespaces or selectors

* – [`parent()`](http://api.jquery.com/parent/) – Does not support selectors

* – [`prepend()`](http://api.jquery.com/prepend/)

* – [`prop()`](http://api.jquery.com/prop/)

* – [`ready()`](http://api.jquery.com/ready/)

* – [`remove()`](http://api.jquery.com/remove/)

* – [`removeAttr()`](http://api.jquery.com/removeAttr/)

* – [`removeClass()`](http://api.jquery.com/removeClass/)

* – [`removeData()`](http://api.jquery.com/removeData/)

* – [`replaceWith()`](http://api.jquery.com/replaceWith/)

* – [`text()`](http://api.jquery.com/text/)

* – [`toggleClass()`](http://api.jquery.com/toggleClass/)

* – [`triggerHandler()`](http://api.jquery.com/triggerHandler/) – Passes a dummy event object to handlers.

* – [`unbind()`](http://api.jquery.com/off/) – Does not support namespaces

* – [`val()`](http://api.jquery.com/val/)

* – [`wrap()`](http://api.jquery.com/wrap/)

相关文章

  • Angular内嵌jqlite语法大全

    AngularJS强化了前端的MVC逻辑,却弱化了Jquery的Dom操作能力。 好在Angular自身也考虑到这...

  • jqLite是怎么回事

    jqLite是JQuery库的子集,它允许angular以跨浏览器兼容的方式维护DOM。jqLite并不试图覆盖j...

  • Angular 语法大全

    今日上班的时候有看到一篇关于angular语法的总结,个人觉得不错,内容如下: 引导 NgModules 模板语法...

  • angular操作DOM

    AngularJS操作DOM -- jqLite Angular不鼓励依赖jQuery库,但是在应用中仍然使用它。...

  • SQL 语法大全

    SQL 语法大全 标签(空格分隔): SQL DB2 SQL语法大全 SQL SELECT SQL SELECT ...

  • java的正则表达式

    正则语法大全

  • Angular2语法

    Angular2语法

  • Angular4-学习笔记-4-模板语法

    学习资料来自 Angular.cn 与 Angular.io。 模板语法 在线例子 在 Angular 中,组件扮...

  • Markdown语法大全(超级版)

    Markdown语法大全(超级版)

  • jQLite

    angular内部封装了基本的JQ功能。但是,如果要使用全部功能的话,同样需要导入jqery库。而且在导入jque...

网友评论

    本文标题:Angular内嵌jqlite语法大全

    本文链接:https://www.haomeiwen.com/subject/ottclttx.html