0
votes

I need some help with my angular app , I have a .net core application using Angular 6 as the front end. Now in Angular app there is an APP Module and there a feature Module. App module contains the nav-bar menu. And Feature module has a home Component and some other components. I also have a separate Login application ( which is in .net) .

Now Login app is used for authentication and on successful authentication Angular app home Component gets called through router-outlet. this is my app component

Now how do I pass data from home component which is routed through router-outlet to nav-bar

1
You can use RxJs Subject also For More coding-karma.com/2018/05/06/…Dan Patil

1 Answers

1
votes

You can achieve it via either of the following ways - 1. Have a service which will maintain the shared data. This data will be updated by HomeComponent and watched by your NavMenuComponent. This data could be in the form of observable. 2. Use a store like ngrx or ngxs to maintain your state. As ngrx or ngxs are redux based and reactive, it will be super easy to achieve the thing that you would like to achieve. Although it is a bit learning curve.