div class=mb-2 span class=p-input-icon-left style=width 100 i class=pi pi-searchi input ngModel=searchKeyword class=mr-2 pInputText style=width 100; text-align center placehol
In component.ts:
filterServices() { this.categories.forEach(category => { category.services.forEach(service => { if (service.name.toLowerCase().includes(this.searchKeyword.toLowerCase())) { service.hidden = false; category.collapsed = false; } else { service.hidden = true; } }); });
原文地址: http://www.cveoy.top/t/topic/fyMn 著作权归作者所有。请勿转载和采集!