Angular 5 共享模块,共享模块要使用管道
Angular 5 Shared module, shared modules want to use pipes
我有一个共享模块,它将不同的模块、组件和管道导出到应用程序中的其余模块。
这很好用,但是 (!!!) 我有一个问题我无法理解。
我有一个模块使用在共享模块中声明的管道。模块在共享模块中导入。
共享模块:
imports: [
moduleOne
],
declarations:[
pipeShared
],
exports:[
moduleOne
pipeShared
]
现在无法在moduleOne中声明Pipe,也无法在moduleOne中导入sharedModule
据我所知,没有办法从我很重要的模块中使用 component/pipe,例如模块A,模块B。模块A提供pipies。模块 B 对模块 A 很重要。模块 B 不能使用模块 A 的管道。我认为您需要创建一个 "shared" 模块。
我有一个共享模块,它将不同的模块、组件和管道导出到应用程序中的其余模块。
这很好用,但是 (!!!) 我有一个问题我无法理解。
我有一个模块使用在共享模块中声明的管道。模块在共享模块中导入。
共享模块:
imports: [
moduleOne
],
declarations:[
pipeShared
],
exports:[
moduleOne
pipeShared
]
现在无法在moduleOne中声明Pipe,也无法在moduleOne中导入sharedModule
据我所知,没有办法从我很重要的模块中使用 component/pipe,例如模块A,模块B。模块A提供pipies。模块 B 对模块 A 很重要。模块 B 不能使用模块 A 的管道。我认为您需要创建一个 "shared" 模块。