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';
|
2016-06-10 13:21:53 -04:00
|
|
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
2015-12-03 18:49:09 -05:00
|
|
|
|
2016-02-11 20:01:17 -05:00
|
|
|
var MyApp: any;
|
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-06-02 20:30:40 -04:00
|
|
|
bootstrap(MyApp, [{provide: UrlResolver, useClass: MyUrlResolver}]);
|
2015-12-03 18:49:09 -05:00
|
|
|
// #enddocregion
|