Strongest password policy
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
9b17a6c4f8
commit
8fdf8fb10c
@@ -13,6 +13,7 @@ import { FormatNumberPipe } from './format-number.pipe';
|
||||
import { YesnoPipe } from './yesno.pipe';
|
||||
import { PrettyPrintPipe } from './pretty-print.pipe';
|
||||
import { TranslateCatalogPipe } from './translate-catalog.pipe';
|
||||
import { TruncateTextPipe } from './truncate-text.pipe';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -30,7 +31,8 @@ import { TranslateCatalogPipe } from './translate-catalog.pipe';
|
||||
FormatNumberPipe,
|
||||
YesnoPipe,
|
||||
PrettyPrintPipe,
|
||||
TranslateCatalogPipe],
|
||||
TranslateCatalogPipe,
|
||||
TruncateTextPipe],
|
||||
providers: [StatusLookupPipe,
|
||||
AccountsFilterPipe,
|
||||
ChargesFilterPipe,
|
||||
@@ -43,7 +45,8 @@ import { TranslateCatalogPipe } from './translate-catalog.pipe';
|
||||
FormatNumberPipe,
|
||||
YesnoPipe,
|
||||
PrettyPrintPipe,
|
||||
TranslateCatalogPipe],
|
||||
TranslateCatalogPipe,
|
||||
TruncateTextPipe],
|
||||
exports: [StatusLookupPipe,
|
||||
AccountsFilterPipe,
|
||||
ChargesFilterPipe,
|
||||
@@ -56,6 +59,7 @@ import { TranslateCatalogPipe } from './translate-catalog.pipe';
|
||||
FormatNumberPipe,
|
||||
YesnoPipe,
|
||||
PrettyPrintPipe,
|
||||
TranslateCatalogPipe]
|
||||
TranslateCatalogPipe,
|
||||
TruncateTextPipe]
|
||||
})
|
||||
export class PipesModule { }
|
||||
|
||||
@@ -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