refactor(common): rename UrlChangeEvent and UrlChangeListener to LocationChangeEvent and LocationChangeListener

These apis are not expected to be used anyone, hence I'm not documenting this change as a breaking.
This commit is contained in:
Igor Minar
2016-08-23 14:26:31 -07:00
committed by Victor Berchet
parent 8a2324f86a
commit 1f5a5895e5
9 changed files with 37 additions and 36 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {PlatformLocation, UrlChangeListener} from '@angular/common';
import {LocationChangeListener, PlatformLocation} from '@angular/common';
import {Injectable} from '@angular/core';
import {getDOM} from '../../dom/dom_adapter';
@ -45,11 +45,11 @@ export class BrowserPlatformLocation extends PlatformLocation {
getBaseHrefFromDOM(): string { return getDOM().getBaseHref(); }
onPopState(fn: UrlChangeListener): void {
onPopState(fn: LocationChangeListener): void {
getDOM().getGlobalEventTarget('window').addEventListener('popstate', fn, false);
}
onHashChange(fn: UrlChangeListener): void {
onHashChange(fn: LocationChangeListener): void {
getDOM().getGlobalEventTarget('window').addEventListener('hashchange', fn, false);
}