Horje
CanDeactivate does not work if we click on cancel in the first time Code Example
CanDeactivate does not work if we click on cancel in the first time
export class CanDeactivateGuard implements CanDeactivate<any> {
    constructor(
        private readonly location: Location,
        private readonly router: Router
    ) {}

    canDeactivate(component: any, currentRoute: ActivatedRouteSnapshot): boolean {
        if (myCondition) {
            const currentUrlTree = this.router.createUrlTree([], currentRoute);
            const currentUrl = currentUrlTree.toString();
            this.location.go(currentUrl);
            return false;
        } else {
            return true;
        }
    }
}




Whatever

Related
kloppy, public datasets, Standardized models, football tracking, data science Code Example kloppy, public datasets, Standardized models, football tracking, data science Code Example
convert multiple file names from uppercase to lowercase Code Example convert multiple file names from uppercase to lowercase Code Example
1 / 9200 Code Example 1 / 9200 Code Example
sap delete baldat report Code Example sap delete baldat report Code Example
inlfate custom  view using data binding android Code Example inlfate custom view using data binding android Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7