-
Notifications
You must be signed in to change notification settings - Fork 66
Add support for back button / history #122
Comments
There is! app-route and app-location automatically add entries to the browser's history. You can programmatically go back using native apis like Docs here: https://developer.mozilla.org/en-US/docs/Web/API/Window/history |
Note though that you can't detect that it was a back button event, and do something special (like restore scroll position). There's already an issue open for that—#86. |
Here's what I'd like to be able to do:
Admittedly, this would require some integration with the app-layout component, but it would cut down on some of the repetitive work that has to be done to create an SPA, and would let the developer focus on the individual views. |
@phidias51 For displaying title based on data-bindings, you can use an element like https://github.com/zacharytamas/page-title/. You could ask that author to also include i18n. |
Can you clarify your first point? Are you talking about something firing popstate events? Something listening for them? iron-location and thus app-location listens for As for propagating title, my suspicion is that that may in fact be a separate concern from The page title is less integrated into routing than it appears, in part because all browsers ignore the title parameter to pushState and replaceState. |
This is what I do... My backButton.html element:
May help someone.. |
It would be useful if there was built-in support for the back button.
The text was updated successfully, but these errors were encountered: