Strongest password policy
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
9b17a6c4f8
commit
8fdf8fb10c
@@ -0,0 +1,21 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'truncateText'
|
||||
})
|
||||
export class TruncateTextPipe implements PipeTransform {
|
||||
|
||||
transform(value: string, chars: number): string {
|
||||
if (value.length <= 40) {
|
||||
return value;
|
||||
}
|
||||
|
||||
let truncatedText = value.substring(0, 30);
|
||||
if (chars) {
|
||||
truncatedText = value.substring(0, chars);
|
||||
}
|
||||
|
||||
return truncatedText;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user