I\'ve been reading some articles about Angular 2 pitfalls and what to avoid, one of those things revolves around not accessing the DOM directly.
I noticed that the
In case someone is still looking for this (as I did), i shall add up a bit on David's answer which was on Angular's native renderer.
You have all this requested functionality in newest Angular Renderer2
Particularly if you want to completely remove attributes (ex. invalid aria tags in community components that fail accessibility tests) from elements and not set their value to null, there is
renderer2.removeAttribute(elementRef.nativeElement, 'AttributeName');
EDIT: You should use AfterViewInit() lifecycle, as described in other answers, as the initial view must be rendered before you make any custom DOM changes.