My application is roughly structured as such: <app-header></app-header> <app-main></app-main> <app-footer></app-footer> The header contains a link to this command: this.keycloakService.logout(); It bypasses the "if (component.form.dirty)" in the main part. I would like to ask the users if they want to save when it happens. Continue reading...