| 
									
										
										
										
											2015-12-03 15:49:09 -08:00
										 |  |  | import {provide} from 'angular2/core'; | 
					
						
							| 
									
										
										
										
											2016-03-17 12:49:46 -07:00
										 |  |  | import {bootstrap} from 'angular2/platform/browser'; | 
					
						
							| 
									
										
										
										
											2015-12-03 15:49:09 -08:00
										 |  |  | import {UrlResolver} from 'angular2/compiler'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-11 17:01:17 -08:00
										 |  |  | var MyApp: any; | 
					
						
							| 
									
										
										
										
											2015-12-03 15:49:09 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // #docregion url_resolver
 | 
					
						
							|  |  |  | class MyUrlResolver extends UrlResolver { | 
					
						
							|  |  |  |   resolve(baseUrl: string, url: string): string { | 
					
						
							|  |  |  |     // Serve CSS files from a special CDN.
 | 
					
						
							|  |  |  |     if (url.substr(-4) === '.css') { | 
					
						
							|  |  |  |       return super.resolve('http://cdn.myapp.com/css/', url); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return super.resolve(baseUrl, url); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bootstrap(MyApp, [provide(UrlResolver, {useClass: MyUrlResolver})]); | 
					
						
							|  |  |  | // #enddocregion
 |