New Dart prose, update Dart and Ts code + guide/server-communication/ts: update to docs and example code + guide/server-communication/dart: new prose, update example code + ignore all npm-debug.logs + make Jade ul li TOC elements more compact.
27 lines
661 B
Dart
27 lines
661 B
Dart
// #docplaster
|
|
// #docregion
|
|
// #docregion just-get-heroes
|
|
import 'dart:async';
|
|
|
|
import 'package:angular2/core.dart';
|
|
|
|
import 'hero.dart';
|
|
import 'mock_heroes.dart';
|
|
|
|
@Injectable()
|
|
class HeroService {
|
|
// #docregion get-heroes
|
|
Future<List<Hero>> getHeroes() async => mockHeroes;
|
|
// #enddocregion get-heroes
|
|
// #enddocregion just-get-heroes
|
|
// See the "Take it slow" appendix
|
|
// #docregion get-heroes-slowly
|
|
Future<List<Hero>> getHeroesSlowly() {
|
|
return new Future.delayed(const Duration(seconds: 2), () => mockHeroes);
|
|
}
|
|
// #enddocregion get-heroes-slowly
|
|
// #docregion just-get-heroes
|
|
}
|
|
// #enddocregion just-get-heroes
|
|
// #enddocregion
|