mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ACS-7597] Convert Core pipes to Standalone # (#9560)
This commit is contained in:
@@ -20,12 +20,11 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
import { UserLike } from './user-like.interface';
|
||||
|
||||
@Pipe({
|
||||
name: 'usernameInitials'
|
||||
name: 'usernameInitials',
|
||||
standalone: true
|
||||
})
|
||||
export class InitialUsernamePipe implements PipeTransform {
|
||||
|
||||
constructor(private sanitized: DomSanitizer) {
|
||||
}
|
||||
constructor(private sanitized: DomSanitizer) {}
|
||||
|
||||
transform(user: UserLike & { displayName?: string }, className: string = '', delimiter: string = ''): SafeHtml {
|
||||
let safeHtml: SafeHtml = '';
|
||||
@@ -42,8 +41,8 @@ export class InitialUsernamePipe implements PipeTransform {
|
||||
}
|
||||
|
||||
getInitialUserName(firstName: string, lastName: string, delimiter: string): string {
|
||||
firstName = (firstName ? firstName[0] : '');
|
||||
lastName = (lastName ? lastName[0] : '');
|
||||
firstName = firstName ? firstName[0] : '';
|
||||
lastName = lastName ? lastName[0] : '';
|
||||
return firstName + delimiter + lastName;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user