0

I try to use pipe in ionic project but can't change data, It shows some error. please suggest a solution for this.

pipe:

@Pipe({
  name: 'statusupdater'
})
export class StatusUpdater {

  transform(value, args) {
    let status=value;
    if(value=='L')
    {
      status='Landed'
    }
    if(value=='A')
    {
      status='Estimated'
    }
    if(value=='C')
    {
      status='Cancelled'
    }

    return status;
  }
}

html:

<span>{{item.status | statusupdator}}</span>

Error:

enter image description here

JSON Derulo
  • 9,780
  • 7
  • 39
  • 56
Faizy Fazz
  • 35
  • 10

2 Answers2

1

You're missing implementing the PipeTransform interface.

@Pipe({
  name: 'statusupdater'
})
export class StatusUpdater implements PipeTransform {
   ...
}
JSON Derulo
  • 9,780
  • 7
  • 39
  • 56
0

You declare it as 'statusupdatEr' but then use it as 'statusupdatOr'.

ACEG
  • 1,981
  • 6
  • 33
  • 61