【发布时间】:2019-04-23 02:09:04
【问题描述】:
如何在 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}} 但未调用 SomePipe 的 transform 方法。
【问题讨论】:
标签: angular pipe angular6 angular-pipe angular-library