Advertisement
bennyp

Untitled

Jul 24th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Pipe, PipeTransform } from '@angular/core';
  2.  
  3. @Pipe({
  4.   name: 'condition',
  5.   pure: false
  6. })
  7. export class ConditionPipe implements PipeTransform {
  8.  
  9.   transform(value: number): any {
  10.     switch (value) {
  11.       case 0: return 'Damaged';
  12.       case 1: return 'Rough';
  13.       case 2: return 'Average';
  14.       case 3: return 'Clean';
  15.       case 4: return 'Outstanding';
  16.     }
  17.  
  18.   }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement