I want to write my own simple browser history solution for my polymer app. Normally I would listen for the window event 'popstate' and go from there. Problem I have with polymer is that I can still listen and catch the popstate event outside my polymer code, but then I need to change a property, 'pageSelected' of my polymer component.
Here is my normal event listener
window.addEventListener('popstate', function(e) {
console.log('do something');
});
I tried to listen for it in my polymer app component by adding
listeners: {
'window.popstate': '_handlePopstate'
}
But I didn't have any luck. So I think two solutions could help
1. How can I listen to browser events such as popstate in my Polymer object?
or
2. If I listen outside my Polymer object, how can I update a property of my Polymer object from outside?
I don't want to use any premade solutions, mainly just so I can learn more how Polymer works. Thanks in advance for any advice/help.