Skip to content

Commit

Permalink
Refactor #10811
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Nov 8, 2021
1 parent 704bdfc commit c559ee2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/showcase/components/icons/icons.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h5>Download</h5>
</app-code>

<h5>Getting Started</h5>
<p>PrimeIcons use the <strong>pi pi-&#123;icon&#125;</strong> syntax such as <strong>pi pi-check</strong>.
<p>PrimeIcons use the <strong>pi pi-&#123;icon&#125;</strong> syntax such as <strong>pi pi-check</strong>.
A standalone icon can be displayed using an element such as <i>i</i> or <i>span</i></p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
Expand Down Expand Up @@ -84,7 +84,7 @@ <h5>Constants</h5>
<h5>List of Icons</h5>
<p>Here is the current list of PrimeIcons, more icons will be added periodically. You may also <a href="https://github.com/primefaces/primeicons/issues">request new icons</a> at the issue tracker.</p>
<div>
<input class="icon-filter" (input)="onFilter($event)" pInputText placeholder="Search an icon">
<input class="icon-filter" (input)="onFilter($event)" pInputText placeholder="Search an icon">
</div>

<div class="p-grid icons-list">
Expand Down
16 changes: 10 additions & 6 deletions src/app/showcase/components/icons/icons.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ import { IconService } from '../../service/iconservice';
export class IconsComponent implements OnInit {

icons: any [];
filteredIcons: 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)
Expand All @@ -34,7 +38,7 @@ export class IconsComponent implements OnInit {

onFilter(event: KeyboardEvent): void {
let searchText = (<HTMLInputElement> event.target).value;

if (!searchText) {
this.filteredIcons = this.icons
}
Expand All @@ -44,4 +48,4 @@ export class IconsComponent implements OnInit {
});
}
}
}
}
2 changes: 1 addition & 1 deletion src/assets/showcase/data/icons.json

Large diffs are not rendered by default.

0 comments on commit c559ee2

Please sign in to comment.