*ngIf not working with <ais-instantsearch> example <ais-instantsearch *ngIf="router.url != '/checkout'" [config]="instantsearchConfig"></<ais-instantsearch> 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(); } } };
*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();
}
}
};