Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions src/location/locationConfig.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
/** @module ng2 */
/** */

import { UIRouter, is, isDefined } from "ui-router-core";
import { UIRouter, is, BrowserLocationConfig } from "ui-router-core";
import { LocationStrategy, PathLocationStrategy } from "@angular/common";

export class Ng2LocationConfig {
private _isHtml5: boolean;
private _hashPrefix: string = "";

export class Ng2LocationConfig extends BrowserLocationConfig {
constructor(router: UIRouter, private _locationStrategy: LocationStrategy) {
this._isHtml5 = is(PathLocationStrategy)(_locationStrategy);
super(router, is(PathLocationStrategy)(_locationStrategy))
}

dispose() {}
port = () => null as number;
protocol = () => null as string;
host = () => null as string;
baseHref = () => this._locationStrategy.getBaseHref();
html5Mode = () => this._isHtml5;
hashPrefix = (newprefix?: string): string => {
if (isDefined(newprefix)) {
this._hashPrefix = newprefix;
}
return this._hashPrefix;
};
}
baseHref(href?: string): string {
return this._locationStrategy.getBaseHref();
}
}