My custom pipe seems to be functioning well, except for the built-in pipes not working within it. I've imported Pipe and can't figure out what could be causing the issue.
Below is the code with the errors:
import { Pipe, PipeTransform } from '@angular/core';
import { Perso } from './perso';
@Pipe({ name: 'startsWithPersoPipe' })
export class StartsWithPersoPipe implements PipeTransform {
transform(Persos: Perso[], search:string){
// Ensure Persos has data before proceeding
if(Persos == null) {
return null;
}
for(let perso of Persos){
console.log(perso.nom); // works fine
console.log(perso.nom | lowercase); // ORIGINAL EXCEPTION: ReferenceError: lowercase is not defined
}
return Persos.filter(p => (p.nom) && (p.nom).startsWith(search)); // works fine
}
}