2018-05-29 02:03:12 +08:00
|
|
|
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>';
|
2019-01-28 06:27:41 +08:00
|
|
|
case SortingMethods.random:
|
|
|
|
return '<span class="oi oi-random"></span>';
|
2018-05-29 02:03:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|