fix(router): generate links for router-link with baseHref

This commit is contained in:
Brian Ford
2015-05-12 16:18:58 -07:00
parent 17392f663f
commit 390cfb793b
4 changed files with 44 additions and 4 deletions

View File

@ -12,18 +12,24 @@ export class SpyLocation extends SpyObject {
urlChanges:List<string>;
_path:string;
_subject:EventEmitter;
_baseHref:string;
constructor() {
super();
this._path = '/';
this.urlChanges = ListWrapper.create();
this._subject = new EventEmitter();
this._baseHref = '';
}
setInitialPath(url:string) {
this._path = url;
}
setBaseHref(url:string) {
this._baseHref = url;
}
path():string {
return this._path;
}
@ -34,6 +40,10 @@ export class SpyLocation extends SpyObject {
});
}
normalizeAbsolutely(url) {
return this._baseHref + url;
}
go(url:string) {
if (this._path === url) {
return;