Update folder structure

This commit is contained in:
Çetin
2021-12-28 13:29:25 +03:00
parent e0762fdeb0
commit ab8f627bb3
71 changed files with 189 additions and 193 deletions

View File

@@ -0,0 +1,53 @@
import { Component, OnInit } from '@angular/core';
import { IconService } from '../../service/iconservice';
@Component({
selector: 'app-iconsdemo',
templateUrl: './icons.component.html',
styleUrls: ['../../../assets/demo/documentation.scss']
})
export class IconsComponent implements OnInit {
icons: any[];
filteredIcons: any[];
selectedIcon: any;
constructor(private iconService : IconService) { }
ngOnInit() {
this.iconService.getIcons().subscribe(data => {
data = data.filter(value => {
return value.icon.tags.indexOf('deprecate') === -1;
});
let icons = data;
icons.sort((icon1, icon2) => {
if(icon1.properties.name < icon2.properties.name)
return -1;
else if(icon1.properties.name < icon2.properties.name)
return 1;
else
return 0;
});
this.icons = icons;
this.filteredIcons = data;
});
}
onFilter(event: KeyboardEvent): void {
const searchText = (event.target as HTMLInputElement).value;
if (!searchText) {
this.filteredIcons = this.icons;
}
else {
this.filteredIcons = this.icons.filter( it => {
return it.icon.tags[0].includes(searchText);
});
}
}
}