BREAKING CHANGE All imports from 'angular2/core/compiler' should be changed to 'angular2/compiler'.
		
			
				
	
	
		
			17 lines
		
	
	
		
			516 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			516 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import {UrlResolver} from 'angular2/src/compiler/url_resolver';
 | |
| 
 | |
| 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);
 | |
|   }
 | |
| }
 |