2016-06-23 12:47:54 -04: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 19:38:52 -04:00
|
|
|
import {UrlResolver} from '@angular/compiler';
|
2019-01-28 15:59:25 -05:00
|
|
|
import {Component, NgModule} from '@angular/core';
|
2016-08-16 14:15:01 -04:00
|
|
|
import {BrowserModule} from '@angular/platform-browser';
|
|
|
|
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
2015-12-03 18:49:09 -05:00
|
|
|
|
2019-01-28 15:59:25 -05:00
|
|
|
@Component({selector: 'my-app', template: 'empty'})
|
|
|
|
class MyApp {
|
|
|
|
}
|
2015-12-03 18:49:09 -05: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 14:15:01 -04:00
|
|
|
@NgModule({
|
|
|
|
imports: [BrowserModule],
|
|
|
|
providers: [{provide: UrlResolver, useClass: MyUrlResolver}],
|
|
|
|
bootstrap: [MyApp]
|
|
|
|
})
|
|
|
|
class AppModule {
|
|
|
|
}
|
|
|
|
|
|
|
|
export function main() {
|
|
|
|
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
|
|
}
|
2015-12-03 18:49:09 -05:00
|
|
|
// #enddocregion
|