Patrice Chalin f06398cd89 docs(toh-6/dart): first edition of prose and example code (#1687)
* docs(toh-6/dart): first edition of prose and example code

NOTE: this PR depends on #1686.

Dart prose and example match TS except that:
- No child-to-parent event emission occurs.
- Support for Add Hero is added as an unconditional feature of the
Heroes view.
- http `_post` takes only a name
- http `delete` takes only a hero id.
- The Dart in-memory-data-service has been dropped in favor of an
implementation based on the "standard" `http.testing.MockClient` class.

* post-review changes
2016-06-28 13:12:49 -07:00

30 lines
810 B
Dart

// #docplaster
// #docregion final
// #docregion v1
import 'package:angular2/core.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2_tour_of_heroes/app_component.dart';
// #enddocregion v1
import 'package:http/http.dart';
import 'package:angular2_tour_of_heroes/in_memory_data_service.dart';
void main() {
bootstrap(AppComponent,
const [const Provider(Client, useClass: InMemoryDataService)]);
}
// #enddocregion final
/*
// #docregion v1
import 'package:http/browser_client.dart';
void main() {
bootstrap(AppComponent, [
provide(BrowserClient, useFactory: () => new BrowserClient(), deps: [])
]);
// Simplify bootstrap provider list to [BrowserClient]
// once there is a fix for:
// https://github.com/angular/angular/issues/9673
}
// #enddocregion v1
*/