如何在 Angular 6 库中添加自定义管道以使其在我的主应用程序中可用?目前我正在这样做:lib.module.ts:
@NgModule({
declarations: [
SomePipe
],
exports: [
SomePipe
]})
在 public_api.ts 中:
export * from './lib/pipes/some.pipe';
在 app.module.ts 中:
import { LibModule } from 'lib';
@NgModule({
...
imports: [
LibModule
]
...
})
我正在尝试使用管道,{{ 'something' | some}}
但未调用transform
方法。SomePipe