Listening for Navigation Change
We will now add the follwing code to the init
function of the Router
window.addEventListener('popstate', event => {
Router.go(event.state.route, false);
});
Our router works!
We will now add the follwing code to the init
function of the Router
window.addEventListener('popstate', event => {
Router.go(event.state.route, false);
});
Our router works!