fix(common): Update types for TypeScript nullability support
This commit is contained in:
@ -66,7 +66,8 @@ export class HashLocationStrategy extends LocationStrategy {
|
||||
}
|
||||
|
||||
pushState(state: any, title: string, path: string, queryParams: string) {
|
||||
let url = this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
|
||||
let url: string|null =
|
||||
this.prepareExternalUrl(path + Location.normalizeQueryParams(queryParams));
|
||||
if (url.length == 0) {
|
||||
url = this._platformLocation.pathname;
|
||||
}
|
||||
|
@ -128,8 +128,8 @@ export class Location {
|
||||
* Subscribe to the platform's `popState` events.
|
||||
*/
|
||||
subscribe(
|
||||
onNext: (value: PopStateEvent) => void, onThrow: (exception: any) => void = null,
|
||||
onReturn: () => void = null): Object {
|
||||
onNext: (value: PopStateEvent) => void, onThrow?: ((exception: any) => void)|null,
|
||||
onReturn?: (() => void)|null): Object {
|
||||
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,9 @@ export abstract class PlatformLocation {
|
||||
abstract onPopState(fn: LocationChangeListener): void;
|
||||
abstract onHashChange(fn: LocationChangeListener): void;
|
||||
|
||||
get pathname(): string { return null; }
|
||||
get search(): string { return null; }
|
||||
get hash(): string { return null; }
|
||||
abstract get pathname(): string;
|
||||
abstract get search(): string;
|
||||
abstract get hash(): string;
|
||||
|
||||
abstract replaceState(state: any, title: string, url: string): void;
|
||||
|
||||
|
Reference in New Issue
Block a user