2015-10-02 12:30:36 -04:00
|
|
|
import {UrlResolver} from 'angular2/src/core/compiler/url_resolver';
|
2015-08-24 20:24:01 -04:00
|
|
|
|
|
|
|
export class TestUrlResolver extends UrlResolver {
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
resolve(baseUrl: string, url: string): string {
|
|
|
|
// The standard UrlResolver looks for "package:" templateUrls in
|
|
|
|
// node_modules, however in our repo we host material widgets at the root.
|
|
|
|
if (url.startsWith('package:angular2_material/')) {
|
|
|
|
return '/base/dist/js/dev/es5/' + url.substring(8);
|
|
|
|
}
|
|
|
|
return super.resolve(baseUrl, url);
|
|
|
|
}
|
|
|
|
}
|