Patrice Chalin 907f848c95 docs(toh-6): refactoring of 'add, edit, delete heroes' (#2170)
* docs(toh-6/dart): refactoring of 'add, edit, delete heroes'

Refactoring of "add, edit, delete heroes" section of toh-6 from one big
bottom-up step into small independent feature slices, where the user
achieves a "milesone" (i.e., can run the full app) after each feature
section. The section rewrite is shorter and offers a better UX.

Other simplifications:
- Error handling is consistent: in the hero service we log to the
console, everwhere else we just let errors bubble up.
- Hero service methods renamed based on function (create, update)
rather then lower-level implementation (post, put).
- @Output properties have been eliminated (since they weren't
explained).

E2E tests now pass on both the TS and Dart sides.

* docs(toh-6/ts): refactoring of 'add, edit, delete heroes'

Refactoring of "add, edit, delete heroes" section of toh-6 from one big
bottom-up step into small independent feature slices, where the user
achieves a "milesone" (i.e., can run the full app) after each feature
section. The section rewrite is shorter and offers a better UX.

Other simplifications:
- Error handling is consistent: in the hero service we log to the
console, everwhere else we just let errors bubble up.
- Hero service methods renamed based on function (create, update)
rather then lower-level implementation (post, put).
- @Output properties have been eliminated (since they weren't
explained).

E2E tests now pass on both the TS and Dart sides.

Post-Dart-review updates included.

* docs(toh-6): ward tweaks
2016-08-26 14:57:45 -07:00

32 lines
938 B
Dart

// #docplaster
// #docregion , v1, v2
import 'package:angular2/core.dart';
import 'package:angular2/platform/browser.dart';
import 'package:angular2_tour_of_heroes/app_component.dart';
// #enddocregion v1
import 'package:angular2_tour_of_heroes/in_memory_data_service.dart';
import 'package:http/http.dart';
void main() {
bootstrap(AppComponent,
[provide(Client, useClass: InMemoryDataService)]
// Using a real back end? Import browser_client.dart and change the above to
// [provide(Client, useFactory: () => new BrowserClient(), deps: [])]
);
}
// #enddocregion v2,
/*
// #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/dart-lang/angular2/issues/37
}
// #enddocregion v1
*/