Testing pop and push state events on windows to see how the router might work.
This commit is contained in:
parent
85fb265651
commit
8bd0a9e661
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user