Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Pipe, PipeTransform } from '@angular/core';
- @Pipe({
- name: 'shortName'
- })
- export class ShortName implements PipeTransform {
- transform(value: any): any {
- let temp = new Array();
- temp = value.split(' ');
- return temp[0] + ' ' + temp[1].substr(0,1);
- }
- }
Add Comment
Please, Sign In to add comment