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 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.
  • [AngularJS] Even... 'Joe Allan Muharsky' via Angular and AngularJS discussion
    • [AngularJS]... Sander Elias
      • Re: [An... 'Joe Allan Muharsky' via Angular and AngularJS discussion
        • Re:... 'Joe Allan Muharsky' via Angular and AngularJS discussion
        • Re:... Sander Elias
          • ... 'Joe Allan Muharsky' via Angular and AngularJS discussion

Reply via email to