Is there any way a component can dynamically register the canDeactivate guard for itself? Its mainly to prompt/stop the user from navigating with confirmation like Yes/No.
I'm trying to do this because the application in question is quite large and workflow components (example: payment, transfer, etc) are spread across many different modules in the app. I am not sure if registering them statically in the router config would be a good idea.
I am looking for a way where in the component can prompt and control the navigation similar to guards.