diff --git a/angular/src/providers/platform.ts b/angular/src/providers/platform.ts index 45eb97a4fd..b74ca9fa11 100644 --- a/angular/src/providers/platform.ts +++ b/angular/src/providers/platform.ts @@ -3,6 +3,14 @@ import { BackButtonDetail, Platforms, getPlatforms, isPlatform } from '@ionic/co import { proxyEvent } from '../util/util'; +export class BackButtonEmitter extends EventEmitter { + subscribeWithPriority(priority: number, callback: () => Promise | void) { + return this.subscribe((ev: BackButtonDetail) => { + ev.register(priority, callback); + }); + } +} + @Injectable() export class Platform { @@ -11,7 +19,7 @@ export class Platform { /** * @hidden */ - backButton = new EventEmitter(); + backButton = new BackButtonEmitter(); /** * The pause event emits when the native platform puts the application