Skip to content

Commit 08190dc

Browse files
chalinfiliph
authored andcommitted
[ng] template-syntax example component rename (#326)
This PR is a propagation of a final round of changes made to the TS example; see angular/angular.io#2750 (comment) E2E tests are still passing. Fixes #286
1 parent 35c908e commit 08190dc

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

public/docs/_examples/template-syntax/dart/lib/app_component.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ enum Color { red, green, blue }
1818
directives: const [
1919
HeroDetailComponent,
2020
BigHeroDetailComponent,
21-
MyClickDirective,
22-
MyClickDirective2,
23-
MySizerComponent
21+
ClickDirective,
22+
ClickDirective2,
23+
SizerComponent
2424
])
2525
class AppComponent implements OnInit, AfterViewInit {
2626
@override

public/docs/_examples/template-syntax/dart/lib/app_component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ <h3>
305305

306306
<div>
307307
<!-- #docregion event-binding-3 -->
308-
<!-- `myClick` is an event on the custom `MyClickDirective` -->
308+
<!-- `myClick` is an event on the custom `ClickDirective` -->
309309
<!-- #docregion myClick -->
310310
<div (myClick)="clickMessage=$event">click with myClick</div>
311311
<!-- #enddocregion myClick -->

public/docs/_examples/template-syntax/dart/lib/click_directive.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import 'dart:html';
44
import 'package:angular2/core.dart';
55

66
@Directive(selector: '[myClick]')
7-
class MyClickDirective {
7+
class ClickDirective {
88
// #docregion output-myClick
99
// @Output(alias) [type info] propertyName = ...
1010
@Output('myClick') final EventEmitter clicks = new EventEmitter<String>();
1111

1212
// #enddocregion output-myClick
1313
bool _toggle = false;
1414

15-
MyClickDirective(ElementRef el) {
15+
ClickDirective(ElementRef el) {
1616
Element nativeEl = el.nativeElement;
1717
nativeEl.onClick.listen((Event e) {
1818
_toggle = !_toggle;
@@ -29,11 +29,11 @@ class MyClickDirective {
2929
// ...
3030
outputs: const ['clicks:myClick']) // propertyName:alias
3131
// #enddocregion output-myClick2
32-
class MyClickDirective2 {
32+
class ClickDirective2 {
3333
final EventEmitter clicks = new EventEmitter<String>();
3434
bool _toggle = false;
3535

36-
MyClickDirective2(ElementRef el) {
36+
ClickDirective2(ElementRef el) {
3737
el.nativeElement.onClick.listen((Event e) {
3838
_toggle = !_toggle;
3939
clicks.emit(_toggle ? 'Click2!' : '');

public/docs/_examples/template-syntax/dart/lib/sizer_component.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:angular2/core.dart';
1010
<button (click)="inc()" title="bigger">+</button>
1111
<label [style.font-size.px]="size">FontSize: {{size}}px</label>
1212
</div>''')
13-
class MySizerComponent {
13+
class SizerComponent {
1414
static final defaultPxSize = 14;
1515

1616
@Input()

0 commit comments

Comments
 (0)