search

Home  >  Q&A  >  body text

Angular.js 和 JQuery 如何协同使用?

在angular中,有jqlite。

如果项目中引入了jquery后,就会将jqlite指向jqurey,否则就是使用自己封装的一个简易jquery。

但是无论是哪一种,可用的api都是限定的,没有jquery多。

特别是在angular的指令中,所以我就很疑惑,这两者该如何协同,完全发挥各自的优势呢?

曾经蜡笔没有小新曾经蜡笔没有小新2739 days ago576

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-05-15 16:54:51

    Unless some libraries depend on jQuery, don’t introduce jq. If it can be written in ng, don’t use jq...

    ng's built-in DOM operation is sufficient. Moreover, ng applications should not manually operate the DOM except for directives. If you want to use jq, it is in the directive.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 16:54:51

    Angular Js has its own one called jqlite, which is roughly similar to jQuery in usage, but not as complete;
    If you reference the complete jQuery library in the header, you don’t need to consider jqlite.

    reply
    0
  • Cancelreply