I’m using Angular 8/Algolia 3.35.1.
I want to get the value of the searchbox field - what I’ve typed in - before leaving the search page. I found an example at:
https://www.algolia.com/doc/guides/building-search-ui/widgets/create-your-own-widgets/js/
but the input
value is null at const input = document.querySelector('#searchBox');
Is the #searchBox
ID correct, or was that just an example?
When using the browser debugger, and inspecting input.ais-SearchBox-input
I’m seeing an empty id, where I’d expect to see #searchBox
.
I’m in the ngOnDestroy()
function when trying to get the input
value, because I want the value before I leave the search page.
Thanks,
Bob