7.2 ngOnDestroy needs to test this.subscription

Issue #4 resolved
Mark Oliver created an issue

ngOnDestroy() { if (this.subscription) { this.subscription.unsubscribe(); } }

Comments (2)

  1. Mathieu Chauvinc repo owner

    Hi @invegat

    Thanks for opening this issue. As far as I can tell, there should not be any case were ngOndestroy is called without a (prior) call to ngAfterViewInit which is where the subscription property is set.

    Did you face a case where this.subscription was still null during ngOnDestroy?

    Thanks!

  2. Log in to comment