Can't bind to 'x' since it isn't a known property of 'y'

后端 未结 5 1510
谎友^
谎友^ 2020-12-16 08:56

I have an angular site that contains a component inside another component. I\'m using routing and lazy loading the outer component (ComponentA). The inner component (Compone

5条回答
  •  余生分开走
    2020-12-16 09:40

    I was able to get the application running by removing FeatureBModule entirely. Then the FeatureAModule is correct as it needs to then delcare FeatureBComponent.

    The FeatureAModule then looks like this:

    import { NgModule }       from '@angular/core';
    import { CommonModule }   from '@angular/common';
    
    import { FeatureAComponent }           from './feature-a.component';
    import { FeatureARoutingModule }       from './feature-a-routing.module';
    import { TreeModule }                  from 'angular-tree-component';
    
    import { FeatureBComponent } from '../feature-b/feature-b.component';
    
    @NgModule({
      imports: [
        CommonModule,
        FeatureARoutingModule,
        TreeModule
      ],
      declarations: [
        FeatureAComponent,
        FeatureBComponent
      ]
    })
    export class FeatureAModule {}
    

    I updated the plunker here: https://plnkr.co/edit/mkGH5uG1FGsWWpWbS1Zw?p=preview

提交回复
热议问题