Tim Blasi b6507e37ef feat(dart/transform): Use angular2/platform/browser as bootstrap lib
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
2016-03-21 00:58:17 +00:00

780 B
Raw Blame History

@cheatsheetSection Bootstrapping @cheatsheetIndex 0 @description {@target ts}import {bootstrap} from 'angular2/platform/browser';{@endtarget} {@target js}Available from the ng.platform.browser namespace{@endtarget} {@target dart}import 'package:angular2/platform/browser.dart';{@endtarget}

@cheatsheetItem syntax(ts dart): bootstrap(MyAppComponent, [MyService, provide(...)]);|provide syntax(js): document.addEventListener('DOMContentLoaded', function () { ng.platform.browser.bootstrap(MyAppComponent, [MyService, ng.core.provide(...)]); });|provide description: Bootstraps an application with MyAppComponent as the root component and configures the DI providers. {@target js}Must be wrapped in the event listener to fire when the page loads.{@endtarget}