[英]Module not found: Error: Can't resolve '@angular/core/src/render3': ViewChildren QueryList
(Angular CLI: 1.7.4) (角度 CLI:1.7.4)
I am using ViewChildren in a component.我在组件中使用 ViewChildren。 It is working fine if I define it as
如果我将其定义为,它工作正常
@ViewChildren(TestComponent) testComponents;
However, when I specify the type of testComponents as QueryList:但是,当我将 testComponents 的类型指定为 QueryList 时:
@ViewChildren(TestComponent) testComponents: QueryList<TestComponent>;
it gives error:它给出了错误:
ERROR in./src/app/components/search-component/search.component.ts Module not found: Error: Can't resolve '@angular/core/src/render3' in 'D:\Test Applications\test-application\src\app\components\search-component'
Delete node-module folder and run 'npm install' command from the root directory.This installs all dependencies listed in package.json file.If you want to install specific package,execute'npm i your package name. Delete node-module folder and run 'npm install' command from the root directory.This installs all dependencies listed in package.json file.If you want to install specific package,execute'npm i your package name. Let me know if it dosen't work?
让我知道它是否不起作用?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.