fix(common): add PopStateEvent interface (#13400)

Closes #13378

PR Close #13400
This commit is contained in:
Dzmitry Shylovich
2016-12-12 20:57:22 +03:00
committed by Miško Hevery
parent f89d004c51
commit fe441186e7
2 changed files with 15 additions and 2 deletions

View File

@ -10,6 +10,12 @@ import {EventEmitter, Injectable} from '@angular/core';
import {LocationStrategy} from './location_strategy';
/** @experimental */
export interface PopStateEvent {
pop?: boolean;
type?: string;
url?: string;
}
/**
* @whatItDoes `Location` is a service that applications can use to interact with a browser's URL.
@ -122,7 +128,7 @@ export class Location {
* Subscribe to the platform's `popState` events.
*/
subscribe(
onNext: (value: any) => void, onThrow: (exception: any) => void = null,
onNext: (value: PopStateEvent) => void, onThrow: (exception: any) => void = null,
onReturn: () => void = null): Object {
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
}