i just upgrade my ng2 app from rc.4 to rc.5. what in my app.html is:
<div>
<switch-app [account]="cache.accountInfo" [app]="cache.current_app">
<router-outlet></router-outlet>
</div>
i declare the SwitchAppComponent at app.module.ts:
@NgModule({
imports: [
]
declarations: [
SwitchAppComponent
],
bootstrap: [AppComponent]
})
export class AppModule {
}
then this error has occurred:
More than one component: AppComponent,SwitchAppComponent
[ERROR ->]<switch-app [account]="cache.accountInfo" [app]="cache.current_app"></switch-app>
i checked my app, the selector of AppComponent and SwitchAppComponent is difference.
here is a brief codes of the two component: app-component:
@Component({
selector: '[app]',
styleUrls: ['./app.css', './custom.scss'],
encapsulation: ViewEncapsulation.None,
templateUrl: './app.html'
})
export class AppComponent extends CommonComponent implements OnInit {
cache = cache;
}
switch-app component:
@Component({
selector: 'switch-app',
templateUrl: './switch-app.html'
})
export class SwitchAppComponent implements OnInit {
@Input('app') app;
@Input('account') account;
ngOnInit() { console.log(this.account, this.app);}
}