Skip to content

Commit

Permalink
fix(angular): es6 classes break in ie11 (#16417)
Browse files Browse the repository at this point in the history
fixes #15979
  • Loading branch information
manucorporat authored Nov 21, 2018
1 parent bc3e192 commit ce1fcea
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions angular/src/providers/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ import { BackButtonDetail, Platforms, getPlatforms, isPlatform } from '@ionic/co
import { proxyEvent } from '../util/util';


export class BackButtonEmitter extends EventEmitter<BackButtonDetail> {
constructor() {
super();
}
subscribeWithPriority(priority: number, callback: () => Promise<any> | void) {
return this.subscribe((ev: BackButtonDetail) => {
ev.register(priority, callback);
});
}
export interface BackButtonEmitter extends EventEmitter<BackButtonDetail> {
subscribeWithPriority(priority: number, callback: () => Promise<any> | void): void;
}

@Injectable()
Expand All @@ -22,7 +15,7 @@ export class Platform {
/**
* @hidden
*/
backButton = new BackButtonEmitter();
backButton: BackButtonEmitter = new EventEmitter<BackButtonDetail>() as any;

/**
* The pause event emits when the native platform puts the application
Expand All @@ -47,6 +40,12 @@ export class Platform {
resize = new EventEmitter<void>();

constructor() {
this.backButton.subscribeWithPriority = function(priority, callback) {
return this.subscribe((ev: BackButtonDetail) => {
ev.register(priority, callback);
});
};

proxyEvent(this.pause, document, 'pause');
proxyEvent(this.resume, document, 'resume');
proxyEvent(this.backButton, document, 'ionBackButton');
Expand Down

0 comments on commit ce1fcea

Please sign in to comment.