// #docplaster // #docregion import 'dart:async'; import 'package:angular2/core.dart'; import 'hero.dart'; import 'mock_heroes.dart'; @Injectable() class HeroService { Future> getHeroes() async => HEROES; // See the "Take it slow" appendix Future> getHeroesSlowly() { return new Future>.delayed( const Duration(seconds: 2), () => HEROES // 2 seconds ); } //#docregion get-hero Future getHero(int id) async => HEROES.where((hero) => hero.id == id).first; //#enddocregion get-hero } // #enddocregion