From d24ff437280b71832817819bde5d74d3fc8e6ee6 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 8 Sep 2016 08:38:25 -0700 Subject: [PATCH] examples(lifecycle-hooks): update Dart sample to match TS (#2281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make equivalent TS code changes to Dart sample. This sync’s Dart with all #2177 changes pertinent to Dart. E2E tests pass now for Dart, Suites passed: - public/docs/_examples/lifecycle-hooks/ts --- .../dart/lib/do_check_component.dart | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart index 449b6e0092..3208a18777 100644 --- a/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart +++ b/public/docs/_examples/lifecycle-hooks/dart/lib/do_check_component.dart @@ -1,6 +1,4 @@ // #docregion -import 'dart:convert'; - import 'package:angular2/core.dart'; class Hero { @@ -23,7 +21,7 @@ class Hero { '.hero {background: LightYellow; padding: 8px; margin-top: 8px}', 'p {background: Yellow; padding: 8px; margin-top: 8px}' ]) -class DoCheckComponent implements DoCheck, OnChanges { +class DoCheckComponent implements DoCheck { @Input() Hero hero; @Input() @@ -72,16 +70,6 @@ class DoCheckComponent implements DoCheck, OnChanges { } // #enddocregion ng-do-check - // Copied from OnChangesComponent - ngOnChanges(Map changes) { - changes.forEach((String propName, SimpleChange change) { - String cur = JSON.encode(change.currentValue); - String prev = - change.isFirstChange() ? "{}" : JSON.encode(change.previousValue); - changeLog.add('$propName: currentValue = $cur, previousValue = $prev'); - }); - } - void reset() { changeDetected = true; changeLog.clear();