Quiero replicar el funcionamiento del componente app.config, ya que desde aqui se puede cambiar en tiempo real algunas propiedades del componenten app.main, perto quiero también hacer cambios al componenten app.menu.
Ya intente algunas cosas pero se sale el siguiente error al implementar el AppMenuComponent en el app.config.
constructor(public appMenu: AppMenuComponent, public app: AppMainComponent) {
}
error:
ERROR Error: Uncaught (in promise): NullInjectorError: StaticInjectorError(AppModule)[AppConfigComponent -> AppMenuComponent]:
StaticInjectorError(Platform: core)[AppConfigComponent -> AppMenuComponent]:
NullInjectorError: No provider for AppMenuComponent!
NullInjectorError: StaticInjectorError(AppModule)[AppConfigComponent -> AppMenuComponent]:
StaticInjectorError(Platform: core)[AppConfigComponent -> AppMenuComponent]:
NullInjectorError: No provider for AppMenuComponent!
at NullInjector.get (core.js:1050)
at resolveToken (core.js:17561)
at tryResolveToken (core.js:17487)
at StaticInjector.get (core.js:17302)
at resolveToken (core.js:17561)
at tryResolveToken (core.js:17487)
at StaticInjector.get (core.js:17302)
at resolveNgModuleDep (core.js:31952)
at NgModuleRef_.get (core.js:32925)
at resolveDep (core.js:33484)
at resolvePromise (zone-evergreen.js:793)
at resolvePromise (zone-evergreen.js:752)
at zone-evergreen.js:854
at ZoneDelegate.invokeTask (zone-evergreen.js:400)
at Object.onInvokeTask (core.js:41224)
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Zone.runTask (zone-evergreen.js:168)
at drainMicroTaskQueue (zone-evergreen.js:570)
Comunicacion entre componentes
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Menu no es elemento ancestro de config como App así que no es posible.
Esta página puede ayudar;
https://angular.io/guide/component-interaction
Esta página puede ayudar;
https://angular.io/guide/component-interaction
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests