I keep hearing all the time that it is forbidden to touch the DOM directly in Angular, but I don't understand why and how we can avoid this?
I just don't think it's possible because at some point you will use a third party plugin. And this plugin will access the DOM directly, so what is the point?
The best practice is always to use decorators like ViewChild
, ContentChild
, etc.
For example, someone at Reddit also wrote this.