From 283195685f408c0b01bbba886f3365f7f4895003 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 28 Jun 2016 08:25:12 -0700 Subject: [PATCH] docs(guide/user-input): follow-up to #1654 (#1770) Mainly Dart-side review, following #1654: - Updates to follow style guide - Suites passed: public/docs/_examples/user-input/dart public/docs/_examples/user-input/ts Note: the click-me2 component is not mentioned in the prose, maybe it should be. --- .../user-input/dart/lib/app_component.dart | 4 ++-- .../dart/lib/click_me2_component.dart | 18 ++++++++++++++++++ .../dart/lib/click_me_component.dart | 15 +++++++++------ .../dart/lib/click_me_component_2.dart | 17 ----------------- 4 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 public/docs/_examples/user-input/dart/lib/click_me2_component.dart delete mode 100644 public/docs/_examples/user-input/dart/lib/click_me_component_2.dart diff --git a/public/docs/_examples/user-input/dart/lib/app_component.dart b/public/docs/_examples/user-input/dart/lib/app_component.dart index d86db43cb0..5f2c86f8d9 100644 --- a/public/docs/_examples/user-input/dart/lib/app_component.dart +++ b/public/docs/_examples/user-input/dart/lib/app_component.dart @@ -2,7 +2,7 @@ import 'package:angular2/core.dart'; import 'click_me_component.dart'; -import 'click_me_component_2.dart'; +import 'click_me2_component.dart'; import 'keyup_components.dart'; import 'little_tour_component.dart'; import 'loop_back_component.dart'; @@ -12,7 +12,7 @@ import 'loop_back_component.dart'; templateUrl: 'app_component.html', directives: const [ ClickMeComponent, - ClickMeComponent2, + ClickMe2Component, KeyUpComponentV1, KeyUpComponentV2, KeyUpComponentV3, diff --git a/public/docs/_examples/user-input/dart/lib/click_me2_component.dart b/public/docs/_examples/user-input/dart/lib/click_me2_component.dart new file mode 100644 index 0000000000..3329a6692e --- /dev/null +++ b/public/docs/_examples/user-input/dart/lib/click_me2_component.dart @@ -0,0 +1,18 @@ +// #docregion +import 'package:angular2/core.dart'; + +@Component( + selector: 'click-me2', + template: ''' + + {{clickMessage}}''') +class ClickMe2Component { + String clickMessage = ''; + int _clicks = 1; + + void onClickMe2(dynamic event) { + var evtMsg = + event != null ? ' Event target is ' + event.target.tagName : ''; + clickMessage = ('Click #${_clicks++}. ${evtMsg}'); + } +} diff --git a/public/docs/_examples/user-input/dart/lib/click_me_component.dart b/public/docs/_examples/user-input/dart/lib/click_me_component.dart index c1c7e19f93..c31d92e78b 100644 --- a/public/docs/_examples/user-input/dart/lib/click_me_component.dart +++ b/public/docs/_examples/user-input/dart/lib/click_me_component.dart @@ -1,3 +1,9 @@ +/* FOR DOCS ... MUST MATCH ClickMeComponent template +// #docregion click-me-button + +// #enddocregion click-me-button +*/ + // #docregion import 'package:angular2/core.dart'; @@ -5,15 +11,12 @@ import 'package:angular2/core.dart'; @Component( selector: 'click-me', template: ''' - // #docregion click-me-button - - // #enddocregion click-me-button - {{clickMessage}}''') + + {{clickMessage}}''') class ClickMeComponent { String clickMessage = ''; - onClickMe() { + void onClickMe() { clickMessage = 'You are my hero!'; } } -// #enddocregion click-me-component diff --git a/public/docs/_examples/user-input/dart/lib/click_me_component_2.dart b/public/docs/_examples/user-input/dart/lib/click_me_component_2.dart deleted file mode 100644 index 8047b2280a..0000000000 --- a/public/docs/_examples/user-input/dart/lib/click_me_component_2.dart +++ /dev/null @@ -1,17 +0,0 @@ -// #docregion -import 'package:angular2/core.dart'; - -@Component( - selector: 'click-me2', - template: ''' - {{clickMessage}}''') -class ClickMeComponent2 { - String clickMessage = ''; - int clicks = 1; - - onClickMe2(dynamic event) { - var evtMsg = - event != null ? ' Event target is ' + event.target.tagName : ''; - clickMessage = ('Click #${clicks++}. ${evtMsg}'); - } -}