What is equivalent functionality in Angular?


Using the vanilla instantsearch.js, I made use of onRenderCallBack. What is the equivalent in Angular?



Hi @ecoffman,

Just want to make sure we’re on the same page: you’re speaking about the event that is emitted at the instance level? Here is an example of its usage:

const search = instantsearch({
  // ...

search.on("render", () => {
  // Trigger something on render

If this is what you’re referring to Angular InstantSearch provides a similar solution. It’s undocumented at the moment but the API is available. You can listen to change event on the ais-instantsearch component. Note that the event is called change but it’s the same than render. Here is an example of its usage:

  template: `
    <ais-instantsearch [...] (change)="handleChange($event)">
export class AppComponent {
  handleChange({ results, state }) {
    console.log("change", results, state);

Hope that helps!


Oops. Of course I mean ‘.on(‘render’, this.onRenderCallBack);’ :slight_smile: .
Sorry for that.

This solved what I am trying to implement with your help. Thanks!!! :smile: