| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-08 16:38:52 -07:00
										 |  |  | import {UrlResolver} from '@angular/compiler'; | 
					
						
							| 
									
										
										
										
											2016-08-16 11:15:01 -07:00
										 |  |  | import {NgModule} from '@angular/core'; | 
					
						
							|  |  |  | import {BrowserModule} from '@angular/platform-browser'; | 
					
						
							|  |  |  | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; | 
					
						
							| 
									
										
										
										
											2015-12-03 15:49:09 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-12 14:08:58 +01:00
										 |  |  | let 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); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-16 11:15:01 -07:00
										 |  |  | @NgModule({ | 
					
						
							|  |  |  |   imports: [BrowserModule], | 
					
						
							|  |  |  |   providers: [{provide: UrlResolver, useClass: MyUrlResolver}], | 
					
						
							|  |  |  |   bootstrap: [MyApp] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | class AppModule { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							|  |  |  |   platformBrowserDynamic().bootstrapModule(AppModule); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2015-12-03 15:49:09 -08:00
										 |  |  | // #enddocregion
 |