#similar to canDeactivate
8 messages · Page 1 of 1 (latest)
cause my code is like this right now:
canDeactivate(
component,
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
nextState: RouterStateSnapshot
): Observable<boolean> | Promise<boolean> | boolean {
if (this.canOpen()) {
if (this.Change) {
this.stop();
}
else {
this.save();
}
}
return true;
}
im not actually using the candeactivate functionality i'm just using the ability to execute that code haha
What's your use-case. What do canOpen(), stop() and save() do?
saving a current functionality for later resume or stopping it entirely
i need something like an attribute in c# or something
A canDeactivate guard looks like the right tool for the job, even if it always returns true.
oh so it's not bad logic to do that