Reputation: 224
I have a logout bouton in shared page, but i want to call logout method after clicked. the implementation of my logout function is in app.comoponent.ts
can anyone help?
Upvotes: 0
Views: 1105
Reputation: 224
thank you guys, I juste move my login bouton to a new header component and i move my implimentation to the header.comoponent.ts
Upvotes: 0
Reputation: 349
There are couple solutions to this question.
1.) You have to follow this steps:
2.) You have to follow this steps and Correct one:
Upvotes: 1
Reputation: 222712
You need to make use of Shared service here. Have your method implemented in a shared service and call the method from your login and shared component.
Upvotes: 1