Skip to content

Commit 4ed642f

Browse files
committed
refactor(AppRootUrl): simplify the code
Closes angular#4563
1 parent a7b2ab7 commit 4ed642f

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

modules/angular2/src/core/compiler/anchor_based_app_root_url.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ export class AnchorBasedAppRootUrl extends AppRootUrl {
1111
constructor() {
1212
super("");
1313
// compute the root url to pass to AppRootUrl
14-
var rootUrl: string;
1514
var a = DOM.createElement('a');
1615
DOM.resolveAndSetHref(a, './', null);
17-
rootUrl = DOM.getHref(a);
18-
19-
this.value = rootUrl;
16+
this.value = DOM.getHref(a);
2017
}
2118
}

modules/angular2/src/core/compiler/app_root_url.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,5 @@ import {isBlank} from 'angular2/src/core/facade/lang';
1212
*/
1313
@Injectable()
1414
export class AppRootUrl {
15-
private _value: string;
16-
17-
constructor(value: string) { this._value = value; }
18-
19-
/**
20-
* Returns the base URL of the currently running application.
21-
*/
22-
get value() { return this._value; }
23-
24-
set value(value: string) { this._value = value; }
15+
constructor(public value: string) {}
2516
}

0 commit comments

Comments
 (0)