Angular错误:未捕获的ReferenceError:jQuery未定义

huangapple go评论56阅读模式
英文:

Angular error Uncaught ReferenceError: jQuery is not defined

问题

我在组件中导入了一些JS文件,但当我启动应用时,浏览器报错:Uncaught ReferenceError: jQuery is not defined。我在所有其他文件之前加载了jQuery,所以我不明白它为什么会报错。

英文:

Angular错误:未捕获的ReferenceError:jQuery未定义

I import some js files to my component but when i start app the browser gives me this error:
Uncaught ReferenceError: jQuery is not defined.
I load jquery before everything else so I don't understand how it can give error.

答案1

得分: 1

首先,您需要使用npm安装jquery,还要不要忘记将其添加到index.html文件中,我在图片中展示了它。查看图片描述

英文:

First of all, you need to install jquery using npm, and also don't forget to add it to the index.html file, I have shown it in the photo. enter image description here

huangapple
  • 本文由 发表于 2023年4月19日 19:07:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76053782.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定