If you want to use pipe’s transform()
method in component, you also need to add CustomPipe
to module’s providers:
import { CustomPipe } from '../pipes/custom.pipe';
...
@NgModule({
imports: [ .. ],
declarations: [ CustomPipe ],
exports: [ CustomPipe ],
providers: [ CustomPipe ]
})
export class SharedModule { }