Skip to content

Commit

Permalink
Update can-deactive.guard.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
yzlucas authored Feb 2, 2025
1 parent 71e1786 commit 7f71cc8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface CanComponentDeactivate {
export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate> {
canDeactivate(component: CanComponentDeactivate): Observable<boolean> | Promise<boolean> | boolean {
// If the component doesn't have canDeactivate, allow navigation
if (!component || !Object.hasOwn(component, 'canDeactivate')) {
if (!component?.canDeactivate) {
return true;
}

Expand Down

0 comments on commit 7f71cc8

Please sign in to comment.