I have a list and the plugin (dragula
) I used, adds certain CSS class on certain action. I am using Angular 5. I want to find out the presence of certain class (
You can use id in your html
add viewchild in your.ts
@ViewChild('namebutton') namebutton: ElementRef;
create a function that will trigger the event
actionButton() {
this.namebutton.nativeElement.classList.add('class-to-add')
setTimeout(() => {
this.namebutton.nativeElement.classList.remove('class-to-remove')
}, 1000);
}
and call the function.