How can I setup a global function that can be accessed throughout all views?
In app.component.ts I added a simple method
openShare() {console.log("button clicked")}
and then in my nav I have
<button ion-button right (click)="openShare()">
<ion-icon name="md-share"></ion-icon>
</button>
When I try to access this from any page I get the following.
self.context.openShare is not a function
It does however execute fine if I put it directly in the constructor (e.g this.openShare(); ), but when calling from any page using a (click) function it just doesn't work.
Is app.component.ts not global? I thought this is where I would place it, but maybe I am missing something.
Basically its a function for a simple button on the nav, I need it to be global though since its used on every page.
Any help would be appreciated, still figuring Ionic 2 out.