Angular change indexName dynamically


I’m using Angular Instant Search and things seem to be going great expect for one little glitch: I want to change ais-instantsearch’s config’s indexName parameter dynamically but it doesn’t seem to have any effect. How can this be done?


To clarify, this is how I have my HTML:

appId: algolia.appId,
apiKey: algolia.apiKey,
indexName: activeAccount

And in controller I’m updating the activeAccount variable as needed. However the changes are not reflected to the UI.

I ended up moving my AIS related code to a separate component which is added and removed from the DOM dynamically. Everything seems to work either with ViewChild or with a separate route which loads the AIS component.