Testing pop and push state events on windows to see how the router might work.

This commit is contained in:
Matt Mo 2020-09-10 18:55:49 -07:00
parent 85fb265651
commit 8bd0a9e661

View File

@ -29,11 +29,23 @@ class RouterLink extends IgniteElement {
class RouterView extends IgniteElement {
constructor() {
super();
console.log("Added pop & push state events");
window.addEventListener("popstate", (event) => this.popState(event));
window.addEventListener("pushstate", (event) => this.pushState(event));
}
render() {
return this.template;
}
pushState(event) {
console.log("Window pushState:", event);
}
popState(event) {
console.log("Window popState:", event);
}
}
class RouterLinkTemplate extends IgniteTemplate {