(
$injector: any,
private location: Location,
private platformLocation: PlatformLocation,
private urlCodec: UrlCodec,
private locationStrategy: LocationStrategy,
)
| 60 | private readonly removeOnUrlChangeFn: VoidFunction; |
| 61 | |
| 62 | constructor( |
| 63 | $injector: any, |
| 64 | private location: Location, |
| 65 | private platformLocation: PlatformLocation, |
| 66 | private urlCodec: UrlCodec, |
| 67 | private locationStrategy: LocationStrategy, |
| 68 | ) { |
| 69 | const initialUrl = this.browserUrl(); |
| 70 | |
| 71 | let parsedUrl = this.urlCodec.parse(initialUrl); |
| 72 | |
| 73 | if (typeof parsedUrl === 'string') { |
| 74 | throw 'Invalid URL'; |
| 75 | } |
| 76 | |
| 77 | this.$$protocol = parsedUrl.protocol; |
| 78 | this.$$host = parsedUrl.hostname; |
| 79 | this.$$port = parseInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null; |
| 80 | |
| 81 | this.$$parseLinkUrl(initialUrl, initialUrl); |
| 82 | this.cacheState(); |
| 83 | this.$$state = this.browserState(); |
| 84 | |
| 85 | this.removeOnUrlChangeFn = this.location.onUrlChange((newUrl, newState) => { |
| 86 | this.urlChanges.next({newUrl, newState}); |
| 87 | }); |
| 88 | |
| 89 | if (isPromise($injector)) { |
| 90 | $injector.then(($i) => this.initialize($i)); |
| 91 | } else { |
| 92 | this.initialize($injector); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | private initialize($injector: any) { |
| 97 | const $rootScope = $injector.get('$rootScope'); |
nothing calls this directly
no test coverage detected