Can anyone help with how to find \'All\' Elements with a particular class name in Angular 2? I thought it would be trivial but it\'s giving me more problems that was prepar
Angular 10+ document compatibility with SSR, import:
import { DOCUMENT } from '@angular/common'
then inject:
constructor(@Inject(DOCUMENT) private _document: HTMLDocument) {
}
And use in your component/ directive like this:
doSomething(): void {
this._document.querySelectorAll('.classImLookingFor')
}