JonnyBGod / ngx-scrollspy

Angular ScrollSpy Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ScrollSpyElementDirective import causing error in browser.

waleed-shahzaib opened this issue · comments

The error says:
Uncaught Error: Type ScrollSpyElementDirective is part of the declarations of 2 modules: ScrollSpyModule and AppModule! Please consider moving ScrollSpyElementDirective to a higher module that imports ScrollSpyModule and AppModule.

I am getting this error in browser, the ScrollSpyElementDirective is imported only one time and added in @NgModule imports metadata.

I am importing these:
import { ScrollSpyModule, ScrollSpyService, ScrollSpyElementDirective } from 'ngx-scrollspy';
Is it OK if I don't import ScrollSpyElementDirective, whether ScrollSpyElementDirective is included in ScrollSpyModule which I've also imported.
Please help. Thanks

Solved the issue, ScrollSpyElementDirective was not needed to import. ScrollSpyModule already contains it.