Block view.

This commit is contained in:
Simon Lindh
2019-11-12 16:39:59 +08:00
parent bd2bd478ef
commit 309e851ead
24 changed files with 455 additions and 126 deletions

View File

@@ -0,0 +1,9 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'shortenString' })
export class ShortenStringPipe implements PipeTransform {
transform(str: string, length: number = 12) {
const half = length / 2;
return str.substring(0, half) + '...' + str.substring(str.length - half);
}
}