From 4ed642f92189b7d317ec72a22afce30e77c6d165 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 6 Oct 2015 16:28:24 -0700 Subject: [PATCH] refactor(AppRootUrl): simplify the code Closes #4563 --- .../src/core/compiler/anchor_based_app_root_url.ts | 5 +---- modules/angular2/src/core/compiler/app_root_url.ts | 11 +---------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/modules/angular2/src/core/compiler/anchor_based_app_root_url.ts b/modules/angular2/src/core/compiler/anchor_based_app_root_url.ts index 84bb63676f..8881f62623 100644 --- a/modules/angular2/src/core/compiler/anchor_based_app_root_url.ts +++ b/modules/angular2/src/core/compiler/anchor_based_app_root_url.ts @@ -11,11 +11,8 @@ export class AnchorBasedAppRootUrl extends AppRootUrl { constructor() { super(""); // compute the root url to pass to AppRootUrl - var rootUrl: string; var a = DOM.createElement('a'); DOM.resolveAndSetHref(a, './', null); - rootUrl = DOM.getHref(a); - - this.value = rootUrl; + this.value = DOM.getHref(a); } } diff --git a/modules/angular2/src/core/compiler/app_root_url.ts b/modules/angular2/src/core/compiler/app_root_url.ts index 3f730aea81..3cb06d6fd0 100644 --- a/modules/angular2/src/core/compiler/app_root_url.ts +++ b/modules/angular2/src/core/compiler/app_root_url.ts @@ -12,14 +12,5 @@ import {isBlank} from 'angular2/src/core/facade/lang'; */ @Injectable() export class AppRootUrl { - private _value: string; - - constructor(value: string) { this._value = value; } - - /** - * Returns the base URL of the currently running application. - */ - get value() { return this._value; } - - set value(value: string) { this._value = value; } + constructor(public value: string) {} }