mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
23 lines
810 B
TypeScript
23 lines
810 B
TypeScript
import {Pipe, PipeTransform} from '@angular/core';
|
|
import {SortingMethods} from '../../../common/entities/SortingMethods';
|
|
|
|
|
|
@Pipe({name: 'iconizeSorting'})
|
|
export class IconizeSortingMethod implements PipeTransform {
|
|
transform(method: SortingMethods): string {
|
|
switch (method) {
|
|
case SortingMethods.ascName:
|
|
return '<span class="oi oi-sort-ascending"></span><strong>A</strong>';
|
|
case SortingMethods.descName:
|
|
return '<span class="oi oi-sort-descending"></span><strong>A</strong>';
|
|
case SortingMethods.ascDate:
|
|
return '<span class="oi oi-sort-ascending"></span>';
|
|
case SortingMethods.descDate:
|
|
return '<span class="oi oi-sort-descending"></span>';
|
|
case SortingMethods.random:
|
|
return '<span class="oi oi-random"></span>';
|
|
}
|
|
}
|
|
}
|
|
|