In SPA, Everything gets routed using routing mechanism. I just want to listen to an event whenever any part of url changes (Not just the hash but any change )
Following is example of SPA,
https://www.google.in/
https://www.google.in/category
Now whenever url changes from https://cherrycrumble.com/
to https://cherrycrumble.com/en/girls-dresses.html
, I want to capture that event.
I tried,
window.addEventListener("hashchange",function(event){
console.log(this); // this gets fired only when hash changes
});