I have created a toolbar component with some props, which i use on several pages on my app.
Inside the component i have a button, which triggers an action sheet and the action sheet has an action button, which on click should trigger a method in my toolbar component. The action sheets markup itself is inside the template of my toolbar component.
Now the problem is, as the action sheet is global, it always invokes the method of the toolbar component which was created first.
What i want is to call the method of the toolbar component instance, which opened the action sheet.
Is this somehow possible?
Otherwise i see no possibility to access the probs of the toolbar component which invoked the action sheet…
No, i use this component on two pages (A and B) like so:
<toolbar my-prob="Test1"></toolbar>
and
<toolbar my-prob="Test2"></toolbar>
Page A was loaded and then i navigate to Page B, so both pages are instantiated.
When i click the delete button on my toolbar on page B, the action sheet is presented.
If i now click on the action button “Delete”, my doDelete-function is called.
But this is always the doDelete-Function of the toolbar component on Page A.
(It prints always “Test1” on the console)
I want the function inside the component on Page B to be called, but i can’t see a way, how to bind the correct scope to the action sheet.
Hope this makes things a bit better understandable…