Polymer / pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
https://pwa-starter-kit.polymer-project.org
2.36k stars 431 forks source link

Routing and browser back button #377

Closed ivanovivelin closed 4 years ago

ivanovivelin commented 5 years ago

Hi,

I currently have the following in my-app.js:

${this._page === 'shoppingcart'?html`<reference-shopping-cart name="shoppingcart" class="page" ?active="${this._page.match(/^shoppingcart*/)}"></reference-shopping-cart>`:``}
${this._page === 'home'?html`<reference-home-page name="home" class="page active" ?active="${this._page === 'home'}"></reference-home-page>`:``}

If I navigate between shoppingcart and home page using the browser back and forward, the state of those components is never updated unless I do the conditional blocks above. Is there any other way to notify of the route change and re-trigger the component.

sdykae commented 4 years ago

Ahm, event listeners?

stale[bot] commented 4 years ago

This project is no longer under development and will be transitioning to a read-only repo. Thank you for your contributions.