And understand, the code I provided is not the ideal product code; just a distillation of the issue I'm seeing.
Joe Allan Muharsky AlphaSource TL | PeopleOps Facilitator "Stop making decisions for the user based on technology's requirements, and start making decisions on technology based on the user's requirements." On Tue, Mar 21, 2017 at 8:39 AM, Joe Allan Muharsky <[email protected]> wrote: > Hi Sandy, > > Thanks for the quick reply; the behavior I'm looking for is to allow for > runtime modification of the "unregister" bit, which requires toggling in > realtime. > > Joe > > Joe Allan Muharsky > AlphaSource TL | PeopleOps Facilitator > "Stop making decisions for the user based on technology's requirements, > and start making decisions on technology based on the user's requirements." > > On Tue, Mar 21, 2017 at 2:45 AM, Sander Elias <[email protected]> > wrote: > >> Hi Joe, >> >> This is probably an issue in jasmine. I'm sorry, but I currently lack the >> time to dig into this. >> I know this is a test app, but I would program it the other way around >> anyway, so this would not happen. >> >> ngOnInit() { >> if (!this.unregister) { >> let target = this.el.nativeElement.getElementsByClassName('target' >> )[0]; >> this.listener = this.renderer.listen(target, 'click', this.onClick >> ); >> } >> } >> >> This is a tad more efficient, as it only registers an event listener when >> it's needed. >> As an added bonus, your test will run. >> >> Regards >> Sander >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Angular and AngularJS discussion" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/to >> pic/angular/V4RWlqCzdh4/unsubscribe. >> To unsubscribe from this group and all its topics, 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. >> > > -- 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.
