How can I get DOM elements by class, id, selectors (div > .my-i) and properties like in jQuery?
For example:
constructor(private elRef:ElementRef) {}
ngAfterViewInit() {
this.elRef.nativeElement.querySelector('.myClass');
}
This will not work well with Web Workers or Universal, but Angular2 itself doesn't provide something platform-agnostic to query for elements.
See also angular 2 / typescript : get hold of an element in the template