So the first one shows the custom component. On logout click from the navbar, its set to invoke a service to log the user out. The 2nd screenshot shows the service inside of the component that is supposed to be triggered, its mapped to session token correctly and I have confirmed the session is available prior to logout. The 3rd screenshot shows the page where the component is used. Upon clicking the logout button from the page, it never invokes the service from the component. Do you need further clarification?
Every page has the component in the header. I was expecting to only call the service once from the component itself, so that all of the pages could inherit that functionality, but the service never gets invoked. The idea is that the service should be able to logout from any page using the same re-usable code.
1 You can invoke service datasource
2 Service datasource available only on page where it was defined.
3 You can not add datasource to the custom component.
So, in your case it will not be work.
If you want to implement common implementation with services - you need to use "page template" instead of custom component.
For this goal:
1 Create page template.
2 Put there needed components(nav bar, etc).
3 Put on this template page needed service datasource(logout).
4 Invoke this datasource from navbar button click.
5 Create page based on template(1 step).
6 Create other page based on template(1 step).
You can find more info about page template here: https://devcenter.appery.io/documenta...