Wow, just a minor mistake on my part.  I was able to put the listener in 
the 'ready' block and it worked fine.

On Wednesday, January 27, 2016 at 4:22:12 PM UTC-8, Colin Cannon wrote:
>
> 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.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/e7d70580-18ad-4226-886f-00b984834a78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to