有问题林在导入管与此设置的输入:我有经由与Homie.Module和Services.Module连接一dashboard.Module控制板-routing.Module意外管“ValuesPipe”由模块“HomieModule”
这是我Dashboard.Module
import { DashboardRoutingModule } from './dashboard-routing.module';
import { ValuesPipe } from './values-pipe.pipe';
@NgModule({
imports: [ DashboardRoutingModule, CommonModule],
providers: [ HomieService, ServiceService ],
declarations: [ DashboardComponent, ValuesPipe],
exports: [ValuesPipe],
bootstrap: [ DashboardComponent ]
})
export class DashboardModule { }
Homie.Module
import { ValuesPipe } from './../values-pipe.pipe';
@NgModule({
imports: [
CommonModule,
HomieRoutingModule,
FormsModule,
Ng2SearchPipeModule,
ValuesPipe
],
declarations: [HomieListComponent, HomieDetailComponent]
})
export class HomieModule { }
Service.Module
import { ValuesPipe } from './../values-pipe.pipe';
@NgModule({
imports: [
CommonModule,
ServiceRoutingModule,
FormsModule,
Ng2SearchPipeModule,
ValuesPipe
],
declarations: [ServiceDetailComponent, ServiceListComponent]
})
export class ServiceModule { }
错误
core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: Unexpected pipe 'ValuesPipe' imported by the module 'HomieModule'. Please add a @NgModule annotation.
Error: Unexpected pipe 'ValuesPipe' imported by the module 'HomieModule'. Please add a @NgModule annotation.
当我宣布我的烟斗在哥们和服务模块我得到的错误信息:在两个模块声明管。 所以这就是为什么我把我的管道移动到Dashboard.module这是与两个(父)连接的模块。
谢谢!我没有创建另一个模块,因为我使用DashboardModule作为共享模块。答案很完美,非常感谢! –
由于共享模块包含引导进程,因此您不能拥有DashboardModule。所以不要创建一个共享模块而是创建一个新模块。 – micronyks
好吧,我想我有另一个错误,然后:我有另一个模块(app.module)引导声明。 –