export class UrlResolver
export class UrlResolver
exported from angular2/compiler defined in angular2/src/compiler/url_resolver.ts (line 24)
Used by the Compiler
when resolving HTML and CSS template URLs.
This class can be overridden by the application developer to create custom behavior.
See Compiler
Example
Annotations
@Injectable()
@Injectable()
Constructor
constructor(packagePrefix?: string)
constructor(packagePrefix?: string)
Not Yet Documented
Members
resolve(baseUrl: string, url: string) : string
resolve(baseUrl: string, url: string) : string
Resolves the url
given the baseUrl
:
- when the
url
is null, thebaseUrl
is returned, - if
url
is relative ('path/to/here', './path/to/here'), the resolved url is a combination ofbaseUrl
andurl
, - if
url
is absolute (it has a scheme: 'http://', 'https://' or start with '/'), theurl
is returned as is (ignoring thebaseUrl
)