Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit b5caaaa

Browse files
committed
Post Ward's review w/ cache updated
- Keep `my-` and `my` prefixes on selectors (for components and directives, respectively). - Drop `my-` from file names. - Drop `My` as component class prefix.
1 parent 2ff5b21 commit b5caaaa

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'package:angular2/common.dart';
77

88
import 'hero.dart';
99
import 'hero_detail_component.dart';
10-
import 'my_click_directive.dart';
11-
import 'my_sizer_component.dart';
10+
import 'click_directive.dart';
11+
import 'sizer_component.dart';
1212

1313
enum Color { red, green, blue }
1414

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ <h3>
306306
<div>
307307
<!-- #docregion event-binding-3 -->
308308
<!-- `myClick` is an event on the custom `MyClickDirective` -->
309-
<!-- #docregion my-click -->
309+
<!-- #docregion myClick -->
310310
<div (myClick)="clickMessage=$event">click with myClick</div>
311-
<!-- #enddocregion my-click -->
311+
<!-- #enddocregion myClick -->
312312
<!-- #enddocregion event-binding-3 -->
313313
{{clickMessage}}
314314
</div>

public/docs/_examples/template-syntax/dart/lib/my_click_directive.dart renamed to public/docs/_examples/template-syntax/dart/lib/click_directive.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import 'package:angular2/core.dart';
55

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

12-
// #enddocregion my-click-output-1
12+
// #enddocregion output-myClick
1313
bool _toggle = false;
1414

1515
MyClickDirective(ElementRef el) {
@@ -21,14 +21,14 @@ class MyClickDirective {
2121
}
2222
}
2323

24-
// #docregion my-click-output-2
24+
// #docregion output-myClick2
2525
@Directive(
26-
// #enddocregion my-click-output-2
26+
// #enddocregion output-myClick2
2727
selector: '[myClick2]',
28-
// #docregion my-click-output-2
28+
// #docregion output-myClick2
2929
// ...
3030
outputs: const ['clicks:myClick']) // propertyName:alias
31-
// #enddocregion my-click-output-2
31+
// #enddocregion output-myClick2
3232
class MyClickDirective2 {
3333
final EventEmitter clicks = new EventEmitter<String>();
3434
bool _toggle = false;

public/docs/ts/_cache/guide/template-syntax.jade

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ block style-property-name-dart-diff
775775

776776
<a id="eventemitter"></a>
777777
<a id="custom-event"></a>
778-
### Custom events with EventEmitter
778+
### Custom events with *EventEmitter*
779779

780780
Directives typically raise custom events with an Angular [EventEmitter](../api/core/index/EventEmitter-class.html).
781781
The directive creates an `EventEmitter` and exposes it as a property.
@@ -860,33 +860,33 @@ block style-property-name-dart-diff
860860
:marked
861861
The `[(x)]` syntax is easy to demonstrate when the element has a settable property called `x`
862862
and a corresponding event named `xChange`.
863-
Here's a `MySizerComponent` that fits the pattern.
863+
Here's a `SizerComponent` that fits the pattern.
864864
It has a `size` value property and a companion `sizeChange` event:
865865

866-
+makeExample('app/my-sizer.component.ts')
866+
+makeExample('app/sizer.component.ts')
867867

868868
:marked
869869
The initial `size` is an input value from a property binding.
870870
Clicking the buttons increases or decreases the `size`, within min/max values constraints,
871871
and then raises (_emits_) the `sizeChange` event with the adjusted size.
872872

873-
Here's an example in which the `AppComponent.fontSizePx` is two-way bound to the `MySizerComponent`:
873+
Here's an example in which the `AppComponent.fontSizePx` is two-way bound to the `SizerComponent`:
874874

875875
+makeExcerpt('app/app.component.html', 'two-way-1', '')
876876

877877
:marked
878-
The `AppComponent.fontSizePx` establishes the initial `MySizerComponent.size` value.
878+
The `AppComponent.fontSizePx` establishes the initial `SizerComponent.size` value.
879879
Clicking the buttons updates the `AppComponent.fontSizePx` via the two-way binding.
880880
The revised `AppComponent.fontSizePx` value flows through to the _style_ binding, making the displayed text bigger or smaller.
881881
Try it in the <live-example></live-example>.
882882

883883
The two-way binding syntax is really just syntactic sugar for a _property_ binding and an _event_ binding.
884-
Angular _desugars_ the `MySizerComponent` binding into this:
884+
Angular _desugars_ the `SizerComponent` binding into this:
885885

886886
+makeExcerpt('app/app.component.html', 'two-way-2', '')
887887

888888
:marked
889-
The `$event` variable contains the payload of the `MySizerComponent.sizeChange` event.
889+
The `$event` variable contains the payload of the `SizerComponent.sizeChange` event.
890890
Angular assigns the `$event` value to the `AppComponent.fontSizePx` when the user clicks the buttons.
891891

892892
Clearly the two-way binding syntax is a great convenience compared to separate property and event bindings.
@@ -1423,7 +1423,7 @@ h3#aliasing-io Aliasing input/output properties
14231423
Directive consumers expect to bind to the name of the directive.
14241424
For example, when we apply a directive with a `myClick` selector to a `<div>` tag,
14251425
we expect to bind to an event property that is also called `myClick`.
1426-
+makeExample('template-syntax/ts/app/app.component.html', 'my-click')(format=".")
1426+
+makeExample('template-syntax/ts/app/app.component.html', 'myClick')(format=".")
14271427
:marked
14281428
However, the directive name is often a poor choice for the name of a property within the directive class.
14291429
The directive name rarely describes what the property does.
@@ -1436,14 +1436,14 @@ h3#aliasing-io Aliasing input/output properties
14361436

14371437
We can specify the alias for the property name by passing it into the input/output decorator like this:
14381438

1439-
+makeExample('template-syntax/ts/app/my-click.directive.ts', 'my-click-output-1')(format=".")
1439+
+makeExample('template-syntax/ts/app/click.directive.ts', 'output-myClick')(format=".")
14401440

14411441
.l-sub-section
14421442
:marked
14431443
We can also alias property names in the `inputs` and `outputs` #{_array}s.
14441444
We write a colon-delimited (`:`) string with
14451445
the directive property name on the *left* and the public alias on the *right*:
1446-
+makeExample('template-syntax/ts/app/my-click.directive.ts', 'my-click-output-2')(format=".")
1446+
+makeExample('template-syntax/ts/app/click.directive.ts', 'output-myClick2')(format=".")
14471447

14481448
<a id="expression-operators"></a>
14491449
.l-main-section

0 commit comments

Comments
 (0)