I need to implement Google CSE when navigating the /search?q=query route.
I navigate form the search input box to the search result page as follows:
'/search + '
' + encodeURIComponent($('
I would like to implement my callback as follows:
script = (document.location.protocol ===
The Google script parses document.location to find the q param and display the results.
Unfortunately, at this stage (callback) the q param is not yet available in document.location.href.
There is no event that triggers after document.location.href is updated and the only way to get it work is to replace router.nivigate by window.location.assign or to use setTimeout.
How it should have been designed (IMHO)
document.location.href should already have been updated with the new route when the route callback function is triggered otherwise router.navigate should be banned when using any api that analyzes the query string.