mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): Removed readonly getters and changed to readonly (#19225)
variables
This commit is contained in:
committed by
Victor Berchet
parent
3aa3d5c548
commit
2b84b86fc0
@@ -114,13 +114,14 @@ export class AnimationRendererFactory implements RendererFactory2 {
|
||||
}
|
||||
|
||||
export class BaseAnimationRenderer implements Renderer2 {
|
||||
readonly data: {[key: string]: any};
|
||||
|
||||
constructor(
|
||||
protected namespaceId: string, public delegate: Renderer2, public engine: AnimationEngine) {
|
||||
this.destroyNode = this.delegate.destroyNode ? (n) => delegate.destroyNode !(n) : null;
|
||||
this.data = delegate.data;
|
||||
}
|
||||
|
||||
get data() { return this.delegate.data; }
|
||||
|
||||
destroyNode: ((n: any) => void)|null;
|
||||
|
||||
destroy(): void {
|
||||
|
||||
@@ -23,7 +23,10 @@ import {supportsState} from './history';
|
||||
*/
|
||||
@Injectable()
|
||||
export class BrowserPlatformLocation extends PlatformLocation {
|
||||
public readonly location: Location;
|
||||
readonly location: Location;
|
||||
readonly search: string;
|
||||
readonly hash: string;
|
||||
|
||||
private _history: History;
|
||||
|
||||
constructor(@Inject(DOCUMENT) private _doc: any) {
|
||||
@@ -36,6 +39,8 @@ 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) !; }
|
||||
@@ -49,8 +54,6 @@ 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 {
|
||||
|
||||
Reference in New Issue
Block a user