【问题标题】:AngularJS2: Include JQuery into applicationAngularJS2:将 JQuery 包含到应用程序中
【发布时间】:2017-02-02 21:29:34
【问题描述】:

经过一个小时的谷歌搜索,我仍然没有找到如何将 JQuery(或任何正常的 JS 文件)正确地包含到我的 AnuglarJS 应用程序中,我该如何解决这个问题?

【问题讨论】:

  • 为什么不在 HTML 本身中加上
  • 如果你使用 AngularJS,为什么你需要包含 jQuery。无论如何,你可以在你的 HTML 中包含任何脚本。
  • 由于某种原因这似乎不起作用
  • does not work for some reason - 在 plnk 或 jsfiddle 中重现您的问题
  • @paritosh 因为我正在使用一个 CSS 库,其中包含一个与 JQuery 一起使用的 JS 库

标签: javascript jquery angularjs node.js


【解决方案1】:

AngularJS 提供 jqLit​​e,它是一个类 jQuery 库,提供了 jQuery 功能的一个子集。但是如果你在你的应用程序中包含 jQuery,它就不起作用。您应该检查一下如何集成 Angular 和 jQuery http://www.bennadel.com/blog/2752-using-jquery-instead-of-jqlite-in-angularjs.htm

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-25
    • 2018-10-05
    • 2016-08-06
    • 2017-11-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多