Revert "refactor(core): Removed readonly getters and changed to readonly (#19225)"

This reverts commit 2b84b86fc0.
This commit is contained in:
Victor Berchet
2017-09-28 13:36:44 -07:00
parent bed8ac70f7
commit 6a9ce67714
14 changed files with 46 additions and 64 deletions

View File

@ -23,10 +23,7 @@ import {supportsState} from './history';
*/
@Injectable()
export class BrowserPlatformLocation extends PlatformLocation {
readonly location: Location;
readonly search: string;
readonly hash: string;
public readonly location: Location;
private _history: History;
constructor(@Inject(DOCUMENT) private _doc: any) {
@ -39,8 +36,6 @@ export class BrowserPlatformLocation extends PlatformLocation {
_init() {
(this as{location: Location}).location = getDOM().getLocation();
this._history = getDOM().getHistory();
(this as{hash: string}).hash = this.location.hash;
(this as{search: string}).search = this.location.search;
}
getBaseHrefFromDOM(): string { return getDOM().getBaseHref(this._doc) !; }
@ -54,6 +49,8 @@ export class BrowserPlatformLocation extends PlatformLocation {
}
get pathname(): string { return this.location.pathname; }
get search(): string { return this.location.search; }
get hash(): string { return this.location.hash; }
set pathname(newPath: string) { this.location.pathname = newPath; }
pushState(state: any, title: string, url: string): void {