2016-04-28 20:50:03 -04:00
|
|
|
import {provide} from '@angular/core';
|
2016-05-19 17:31:21 -04:00
|
|
|
import {bootstrap} from '@angular/platform-browser';
|
2016-04-28 20:50:03 -04:00
|
|
|
import {UrlResolver} from '@angular/compiler';
|
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
|