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:

committed by
Victor Berchet

parent
8a2324f86a
commit
1f5a5895e5
@ -12,7 +12,7 @@ import {isPresent} from '../facade/lang';
|
||||
|
||||
import {Location} from './location';
|
||||
import {APP_BASE_HREF, LocationStrategy} from './location_strategy';
|
||||
import {PlatformLocation, UrlChangeListener} from './platform_location';
|
||||
import {LocationChangeListener, PlatformLocation} from './platform_location';
|
||||
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ export class HashLocationStrategy extends LocationStrategy {
|
||||
}
|
||||
}
|
||||
|
||||
onPopState(fn: UrlChangeListener): void {
|
||||
onPopState(fn: LocationChangeListener): void {
|
||||
this._platformLocation.onPopState(fn);
|
||||
this._platformLocation.onHashChange(fn);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {OpaqueToken} from '@angular/core';
|
||||
import {UrlChangeListener} from './platform_location';
|
||||
import {LocationChangeListener} from './platform_location';
|
||||
|
||||
/**
|
||||
* `LocationStrategy` is responsible for representing and reading route state
|
||||
@ -34,7 +34,7 @@ export abstract class LocationStrategy {
|
||||
abstract replaceState(state: any, title: string, url: string, queryParams: string): void;
|
||||
abstract forward(): void;
|
||||
abstract back(): void;
|
||||
abstract onPopState(fn: UrlChangeListener): void;
|
||||
abstract onPopState(fn: LocationChangeListener): void;
|
||||
abstract getBaseHref(): string;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,8 @@ import {isBlank} from '../facade/lang';
|
||||
|
||||
import {Location} from './location';
|
||||
import {APP_BASE_HREF, LocationStrategy} from './location_strategy';
|
||||
import {PlatformLocation, UrlChangeListener} from './platform_location';
|
||||
import {LocationChangeListener, PlatformLocation} from './platform_location';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -59,7 +60,7 @@ export class PathLocationStrategy extends LocationStrategy {
|
||||
this._baseHref = href;
|
||||
}
|
||||
|
||||
onPopState(fn: UrlChangeListener): void {
|
||||
onPopState(fn: LocationChangeListener): void {
|
||||
this._platformLocation.onPopState(fn);
|
||||
this._platformLocation.onHashChange(fn);
|
||||
}
|
||||
|
@ -34,8 +34,8 @@
|
||||
*/
|
||||
export abstract class PlatformLocation {
|
||||
abstract getBaseHrefFromDOM(): string;
|
||||
abstract onPopState(fn: UrlChangeListener): void;
|
||||
abstract onHashChange(fn: UrlChangeListener): void;
|
||||
abstract onPopState(fn: LocationChangeListener): void;
|
||||
abstract onHashChange(fn: LocationChangeListener): void;
|
||||
|
||||
get pathname(): string { return null; }
|
||||
get search(): string { return null; }
|
||||
@ -55,9 +55,9 @@ export abstract class PlatformLocation {
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export interface UrlChangeEvent { type: string; }
|
||||
export interface LocationChangeEvent { type: string; }
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface UrlChangeListener { (e: UrlChangeEvent): any; }
|
||||
export interface LocationChangeListener { (e: LocationChangeEvent): any; }
|
||||
|
Reference in New Issue
Block a user