Add a template variable to be able to query the element.
<div #patientDDL class="overlay-dropdown dropdown" id="patientDDL">
Query the element
@ViewChild('patientDDL') patientDDL:ElementRef;
Implement ngDoCheck() to run the check whether the class was added when change detection runs:
ngDoCheck() {
if(patientDDL.nativeElement.classList.contains('open')) {
this.doSomething();
}
}
or on some specific event
@HostListener('click', ['$event'])
clickHandler(event) {
if(patientDDL.nativeElement.classList.contains('open')) {
this.doSomething();
}
}