I bought an Angular 4 template to see how the layout is executed, but includes working components. I noticed that they have a set of settings in the application component, which is mainly intended for menus, changing styles, mainly controlling the external structure.
In the menu component and several other components, they exchange data with AppComponent settings using the following:
constructor(@Inject(forwardRef(() => AppComponent)) public app:AppComponent) {}
and will call something like: this.app.darkMenu = true in the menu component
Is this the right project, good, bad, outdated? I did not even know that you can communicate with the App or the parent component, how is it? Should it be an observable subject or an EventEmitter or is it acceptable to communicate via forwardRef? It seems to be like .NET, where I could communicate with MasterPage using this.master.whateverproperty.
I like how forwardRef works, but not sure if I should use it or change it to communicate differently ??
angular primeng
Fab
source share