2017-12-01 10 views

答えて

0
<div #divRef class="abc" (event)="checkStyleClass()"></div> 

@ViewChild('devRef') element: ElementRef; 

    checkStyleClass() { 
       let classes = []; 
       classes = this.element.nativeElement.classList; 
       if (classes) { 
        classes.forEach(classVal => { 
        if (classVal === 'xyz') { 
         // div contains the xyz class after the event 
        } 
        }); 
       } 
       } 
関連する問題