File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change 1
1
/** @module ng2 */
2
2
/** */
3
3
4
- import { UIRouter , is , isDefined } from "ui-router-core" ;
4
+ import { UIRouter , is , BrowserLocationConfig } from "ui-router-core" ;
5
5
import { LocationStrategy , PathLocationStrategy } from "@angular/common" ;
6
6
7
- export class Ng2LocationConfig {
8
- private _isHtml5 : boolean ;
9
- private _hashPrefix : string = "" ;
10
-
7
+ export class Ng2LocationConfig extends BrowserLocationConfig {
11
8
constructor ( router : UIRouter , private _locationStrategy : LocationStrategy ) {
12
- this . _isHtml5 = is ( PathLocationStrategy ) ( _locationStrategy ) ;
9
+ super ( router , is ( PathLocationStrategy ) ( _locationStrategy ) )
13
10
}
14
11
15
- dispose ( ) { }
16
- port = ( ) => null as number ;
17
- protocol = ( ) => null as string ;
18
- host = ( ) => null as string ;
19
- baseHref = ( ) => this . _locationStrategy . getBaseHref ( ) ;
20
- html5Mode = ( ) => this . _isHtml5 ;
21
- hashPrefix = ( newprefix ?: string ) : string => {
22
- if ( isDefined ( newprefix ) ) {
23
- this . _hashPrefix = newprefix ;
24
- }
25
- return this . _hashPrefix ;
26
- } ;
27
- }
12
+ baseHref ( href ?: string ) : string {
13
+ return this . _locationStrategy . getBaseHref ( ) ;
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments