I need your help. I tried this code which works but works not how I want.
$("ul").each(function(){
let thisClass = $(ul).find('.className')
if(thisClass.length >= 2){
thisClass.addClass('done');
}
});
It counted together all elements what I do not want. I want to count separately but I do not know how can goes.
<ul><li></li></ul>
<ul><li></li></ul>
Please help me if you can.
Thanks.
2
Answers
Maybe something like:
It’s a bad idea to use jQuery with Angular, re-think!
Check the code where that list is rendering, and you will have the list of items.
Just get the length of those items.
You are rendering two list means two different variables