It is probably better to use Renderer2 for listening instead of directly accessing the native element.
I think so. Renderer2 have listen method to do that.
listen
Oh thanks a lot for this feedback. I didn't know that before. I'll update the blog post today
Renderer2 listen method doesn't have params that have addEventListener. Actually it's the same as @HostListener.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It is probably better to use Renderer2 for listening instead of directly accessing the native element.
I think so. Renderer2 have
listen
method to do that.Oh thanks a lot for this feedback. I didn't know that before. I'll update the blog post today
Renderer2 listen method doesn't have params that have addEventListener. Actually it's the same as @HostListener.