From ad3fbada106d22a920c645cd1f4468e62280925d Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 21 Nov 2016 04:58:59 -0800 Subject: [PATCH] examples(toh-5, toh-6): fix Dart e2e (#2846) --- .../toh-5/dart/lib/dashboard_component.html | 2 +- .../toh-5/dart/lib/hero_detail_component.dart | 8 +++----- .../toh-6/dart/lib/dashboard_component.dart | 2 +- .../toh-6/dart/lib/dashboard_component.html | 2 +- .../toh-6/dart/lib/hero_detail_component.dart | 13 ++++++------- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/public/docs/_examples/toh-5/dart/lib/dashboard_component.html b/public/docs/_examples/toh-5/dart/lib/dashboard_component.html index f48c102949..56779ce130 100644 --- a/public/docs/_examples/toh-5/dart/lib/dashboard_component.html +++ b/public/docs/_examples/toh-5/dart/lib/dashboard_component.html @@ -2,7 +2,7 @@

Top Heroes

- +

{{hero.name}}

diff --git a/public/docs/_examples/toh-5/dart/lib/hero_detail_component.dart b/public/docs/_examples/toh-5/dart/lib/hero_detail_component.dart index df03c092f3..6a344362ca 100644 --- a/public/docs/_examples/toh-5/dart/lib/hero_detail_component.dart +++ b/public/docs/_examples/toh-5/dart/lib/hero_detail_component.dart @@ -37,15 +37,13 @@ class HeroDetailComponent implements OnInit { // #docregion ngOnInit Future ngOnInit() async { - var idString = _routeParams.get('id'); - var id = int.parse(idString ?? '', onError: (_) => null); + var _id = _routeParams.get('id'); + var id = int.parse(_id ?? '', onError: (_) => null); if (id != null) hero = await (_heroService.getHero(id)); } // #enddocregion ngOnInit // #docregion goBack - void goBack() { - _location.back(); - } + void goBack() => _location.back(); // #enddocregion goBack } diff --git a/public/docs/_examples/toh-6/dart/lib/dashboard_component.dart b/public/docs/_examples/toh-6/dart/lib/dashboard_component.dart index ac71e10e17..952736be7c 100644 --- a/public/docs/_examples/toh-6/dart/lib/dashboard_component.dart +++ b/public/docs/_examples/toh-6/dart/lib/dashboard_component.dart @@ -13,7 +13,7 @@ import 'hero_search_component.dart'; selector: 'my-dashboard', templateUrl: 'dashboard_component.html', styleUrls: const ['dashboard_component.css'], - directives: const [HeroSearchComponent]) + directives: const [HeroSearchComponent, ROUTER_DIRECTIVES]) // #enddocregion search class DashboardComponent implements OnInit { List heroes; diff --git a/public/docs/_examples/toh-6/dart/lib/dashboard_component.html b/public/docs/_examples/toh-6/dart/lib/dashboard_component.html index db8546ccd2..12ca29d8d1 100644 --- a/public/docs/_examples/toh-6/dart/lib/dashboard_component.html +++ b/public/docs/_examples/toh-6/dart/lib/dashboard_component.html @@ -1,7 +1,7 @@

Top Heroes