src/lib/testing/src/mock-url-normalizer.ts
Properties |
Methods |
getBaseHref |
getBaseHref()
|
Returns :
string
|
getLocation |
getLocation()
|
Returns :
LocationInfo
|
init | ||||||||||||||||||||
init(protocol: string, host: string, pathname: string, baseHref: string)
|
||||||||||||||||||||
Parameters :
Returns :
this
|
internalBaseHref |
internalBaseHref:
|
Default value : ''
|
internalHost |
internalHost:
|
Default value : 'localhost'
|
Defined in src/lib/testing/src/mock-url-normalizer.ts:8
|
internalPathname |
internalPathname:
|
Default value : '/'
|
Defined in src/lib/testing/src/mock-url-normalizer.ts:9
|
internalProtocol |
internalProtocol:
|
Default value : 'http:'
|
Defined in src/lib/testing/src/mock-url-normalizer.ts:7
|
import { Injectable } from '@angular/core';
import { BaseUrlNormalizer, LocationInfo } from 'angular-resource-router';
@Injectable()
export class MockUrlNormalizer extends BaseUrlNormalizer {
internalProtocol = 'http:';
internalHost = 'localhost';
internalPathname = '/';
internalBaseHref = '';
init(protocol: string, host: string, pathname: string, baseHref: string) {
this.internalProtocol = protocol;
this.internalHost = host;
this.internalPathname = pathname;
this.internalBaseHref = baseHref;
return this;
}
getBaseHref(): string {
return this.internalBaseHref;
}
getLocation(): LocationInfo {
return {
protocol: this.internalProtocol,
host: this.internalHost,
pathname: this.internalPathname
};
}
}