* example(dart/toh-4,5): getHeroesSlowly() to return getHeroes() Have `getHeroesSlowly()` delay and then return the value of `getHeroes()`. This makes it easier for user’s performing the tutorial to keep this slower method as they evolve toh-5 into toh-6. * example(ts/toh-4,5): getHeroesSlowly() to return getHeroes() Have `getHeroesSlowly()` delay and then return the value of `getHeroes()`. This makes it easier for user’s performing the tutorial to keep this slower method as they evolve toh-5 into toh-6.
23 lines
512 B
Dart
23 lines
512 B
Dart
// #docplaster
|
|
// #docregion final
|
|
// #docregion empty-class
|
|
import 'package:angular2/core.dart';
|
|
|
|
// #enddocregion empty-class
|
|
import 'hero.dart';
|
|
import 'mock_heroes.dart';
|
|
|
|
// #docregion getHeroes-stub
|
|
@Injectable()
|
|
class HeroService {
|
|
// #enddocregion getHeroes-stub, empty-class, final
|
|
/*
|
|
// #docregion getHeroes-stub
|
|
List<Hero> getHeroes() {} // stub
|
|
// #enddocregion getHeroes-stub
|
|
*/
|
|
// #docregion final
|
|
List<Hero> getHeroes() => mockHeroes;
|
|
// #docregion empty-class, getHeroes-stub
|
|
}
|