Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

*ngIf not working with ais-instantsearch #999

Open
NeerajThapliyal opened this issue May 31, 2023 · 0 comments
Open

*ngIf not working with ais-instantsearch #999

NeerajThapliyal opened this issue May 31, 2023 · 0 comments

Comments

@NeerajThapliyal
Copy link

NeerajThapliyal commented May 31, 2023

*ngIf not working with

example
<ais-instantsearch *ngIf="router.url != '/checkout'" [config]="instantsearchConfig"></

this.instantsearchConfig = {
indexName: environment.ALGOLIA_SEARCH_INDEX_NAME,
searchClient: createSSRSearchClient({
makeStateKey,
HttpHeaders,
appId: environment.ALGOLIA_APP_ID,
apiKey: environment.ALGOLIA_API_KEY,
transferState: this.transferState,
httpClient: this.httpClient,
}),
routing: {
router: ssrRouter(() => {
if (this.request) {
// request is only defined on the server side
return this.request.url;
}
return window.location.pathname + window.location.search;
}),
stateMapping: simple(),
},
searchFunction(helper) {
if(helper.state.query && helper.state.query.length > 3) {
helper.search();
}
}
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant