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