Call a function of app component inside html of another component


#1

I am working on ionic 3, angular 5 application.

I have a logout function in header of few pages but i want i define this logout function in app component, how i can do this ?

i need to call same app component’s logout function from html file of my account page.

thanks


#2

hi
you can use shared service provider
you should define method in service provider and call it in any place from your app easily
for more details take look to thes link below it work iin ionic (2/3) :


#3

Thanks for your suggestion