简体   繁体   English

如何在 Stackblitz 中使用 angular 导入 Lodash?

[英]How to import Lodash in Stackblitz with angular?

I wanted to share a problem related to lodash debounce but when i tried to use lodash in Stackbiltz ( angular project ), it is giving me module not found error.我想分享一个与 lodash 去抖动相关的问题,但是当我尝试在 Stackbiltz( angular project )中使用 lodash 时,它给了我未找到模块的错误。

PROBLEM: I have installed lodash in the dependencies but it still giving me error: lodash module not found in stackbiltz Here is the link: https://stackblitz.com/edit/angular-a5pvrq问题:我已经在依赖项中安装了 lodash,但它仍然给我错误:在 stackbiltz 中lodash module not found这里是链接: https : lodash module not found

WHAT I NEED?:我需要的?:

I need to use lodash in stackbiltz for angular.我需要在 stackbiltz 中使用 lodash 来获得角度。

UPDATE: (SOLUTION) @types/lodash was missing in dependencies.更新:(解决方案) @types/lodash 在依赖项中丢失。

Seems that it lacks @types/lodash .似乎它缺少@types/lodash If you install it as a dependency, the error will go off.如果将其安装为依赖项,则错误将消失。 Check stackblitz检查堆栈闪电战

Just go to the dependencies panel under your files list and type the dependency you want to add in your example.只需转到文件列表下的依赖项面板,然后键入要在示例中添加的依赖项。

I did it in your example here .我在你的例子中做到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM