InstantSearch + Angular 1


I’m currently looking into the possibility of using the functionality of the InstantSearch library and using Angular 1 to control the hits layout (among other things). For example, the project has template manipulation like toggling between list and grid view for the hits layout. Is there a callback I can use to save the results returned into a variable? I tried creating a custom widget or connector that did this but it ended up interfering with the urlSync functionality.

Best Regards.

Hi @jaguilar,

Can you share us a live example of what you tried? It can help us give you the best approach and will let us see what’s happening with urlSync.

Also, why not using your toggle to switch between your two hits template?

Hi @marielaure.thuret,

I’ve been testing locally, I’ll see if I can get a demo up on my server. Are you suggesting perhaps using two hits widgets and have one hidden until toggled?

Best Regards.

As you can specify the template of the hits, I was suggestion maybe changing it depending of what’s toggled, but this could work! Did you try?

I’ll give it a try today, in regards to your suggestion, wouldn’t you have to retrigger the search on toggle?

Best Regards.

@jaguilar yes you’re right. Maybe computing both of them and displaying only one is better.