Module not found: Error: Can't resolve '@angular/core/src/render3': ViewChildren QueryList

877 views Asked by At

(Angular CLI: 1.7.4)

I am using ViewChildren in a component. It is working fine if I define it as

@ViewChildren(TestComponent) testComponents;

However, when I specify the type of testComponents as 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'

1

There are 1 answers

1
Bhavya Reddy On

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?