File

src/app/shared/pipes/empty.pipe.ts

Metadata

Name empty

Methods

transform
transform(value: any)
Parameters :
Name Type Optional
value any No
Returns : any
import { Pipe, PipeTransform } from '@angular/core';

import * as _ from 'lodash';

@Pipe({
  name: 'empty'
})
export class EmptyPipe implements PipeTransform {
  transform(value: any): any {
    return _.isUndefined(value) || _.isNull(value) ? '-' : value;
  }
}

result-matching ""

    No results matching ""