Closed sukeshlaghate closed 3 years ago
After digging around the codebase for search in igo2-lib repo I found that SearchService was not part of any providers. Once I included it in IgoSearchModule and rebuilt the libs my integration started working like charm. @mbarbeau Request you to review and add this line of code in IgoSearchModule
...
import { provideSearchSourceService } from './shared/search-source-service.providers';
import { SearchService } from './shared';
...
export class IgoSearchModule {
static forRoot(): ModuleWithProviders<IgoSearchModule> {
return {
ngModule: IgoSearchModule,
providers: [
provideSearchSourceService(),
provideDefaultIChercheSearchResultFormatter(),
provideDefaultCoordinatesSearchResultFormatter(),
provideILayerSearchResultFormatter(),
SearchService, // <=== this is missing in the IgoSearchModule
],
};
}
}
Thank you for the finding. I added the proposed line of code. Best regards
For one of projects I am integrating igo2-lib as mapping library, so far this has proven to be a wonderful library. I am able to implement identify Operation ( when user clicks on map, the application queries layers at point clicked by user and return results).
However when I try to display returned results in igo-search-results component I keep getting NullInjectorError, mentioned in the subject/title of this issue. I am including snippets of the code that I have written. in production.ts where I set the searchSources as part of configuration
In the Dynamically loaded module where map is created I have imported
Map component code where I am handling Query results
In the corresponding HTML code for map component I check if the queryStore is loaded and call igo-search-result component like so
I would appreciate if you could show me what I am missing and point me in right direction for achieving the desired functionality.
Following is the actual error I am getting
Following is the information of my environment Please tell us about your environment:
OS:Ubuntu 20.04 64 bit
Browser:
Chrome Version 87.0.4280.88 (Official Build) (64-bit)
FireFox Version 83.0 (64-bit)
Igo Version: Igo2-lib 1.5.3
Node: v13.14.0
With regards, Sukesh.