b6507e37ef
Update the Angular 2 transformer to recognize `package:angular2/platform/browser.dart` as the library which exports the `bootstrap` function. Update playground, examples, benchmarks, & tests to import bootstrap from platform/browser. Closes #7647
20 lines
557 B
TypeScript
20 lines
557 B
TypeScript
import {provide} from 'angular2/core';
|
|
import {bootstrap} from 'angular2/platform/browser';
|
|
import {UrlResolver} from 'angular2/compiler';
|
|
|
|
var MyApp: any;
|
|
|
|
// #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
|