Guest User

Untitled

a guest
Jan 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import { Pipe, PipeTransform } from '@angular/core';
  2.  
  3. @Pipe({
  4. name: 'shortName'
  5. })
  6.  
  7. export class ShortName implements PipeTransform {
  8. transform(value: any): any {
  9. let temp = new Array();
  10. temp = value.split(' ');
  11. return temp[0] + ' ' + temp[1].substr(0,1);
  12. }
  13. }
Add Comment
Please, Sign In to add comment