Well, that click to post went out too fast :) I've meant to say, look at this plunk to see what I'm talking about:
https://plnkr.co/edit/ifgGessycEUdy7lL0Y57?p=preview On Saturday, October 14, 2017 at 10:05:59 AM UTC+2, Zlatko Đurić wrote: > > Robert, I think it's a simple scope issue. Your iframeClickHandler is > attached to a click freely, which means it's scope is the iframe, not your > component. Hence this.router is undefined. You need to bind that function > to your component, like this: > > if (typeof doc.addEventListener !== undefined) { > doc.addEventListener("click", this.iframeClickHandler*.bind(this)*, > false) > } else if (typeof doc.attachEvent !== undefined) { > doc.attachEvent("onclick", function (this) > {this.iframeClickHandler(this)}*.bind(this)* ) > } > > > > > https://plnkr.co/edit/ifgGessycEUdy7lL0Y57?p=preview > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
