Update template.component.ts

This commit is contained in:
piotrpekala7 2020-05-06 10:03:45 +02:00
parent 11e116f508
commit 79dee73590

View File

@ -51,7 +51,7 @@ export class TemplateComponent implements OnInit {
return item.name.toLowerCase().includes(this.searchText.toLowerCase()); return item.name.toLowerCase().includes(this.searchText.toLowerCase());
}); });
if (this.selectedType === 'all') { if (this.selectedType === 'all' || !this.selectedType) {
this.filteredTemplates = temporaryTemplates; this.filteredTemplates = temporaryTemplates;
} else { } else {
this.filteredTemplates = temporaryTemplates.filter(t => t.template_type === this.selectedType); this.filteredTemplates = temporaryTemplates.filter(t => t.template_type === this.selectedType);