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 (
If you want to change all li.myClass, you can do like this:
Note the #questions
in the container div.
@ViewChild('questions') questions: any;
questions.nativeElement.querySelectorAll('.myClass').forEach(
question => {
question.classList.remove('myClass');
question.classList.add('newClass');
}
)
{{ questions.length == 0 ? ' Drag and drop questions here ' : ' '}}
-
{{question.questionId}} {{question.questionSentence}}