Toggle afterStateUpdated call action

I would like when someone clicks the toggle, that a confirmation modal pop's up asking the user if he's sure that he wants to enable it. How can I do this?
How can I call an action using afterStateUpdated?
Was this page helpful?