You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
* template-syntax - removed word redundancies, consistent bolding rather than italics
* Some (not all) changes from PR.
* remaining changes from pull request
We’re binding the input box `value` to a `firstName` property, and we’re listening for changes by binding to the input box’s `input` event.
771
+
This code sets the input box `value` property by binding to the `firstName` property. To listen for changes to the value, the code binds to the input box's `input` event.
772
772
When the user makes changes, the `input` event is raised, and the binding executes the statement within a context that includes the DOM event object, `$event`.
773
773
774
-
To update the `firstName` property, we must get the changed text by following
775
-
the path `$event.target.value`.
774
+
To update the `firstName` property, the changed text is retrieved by following the path `$event.target.value`.
776
775
777
-
If the event belongs to a directive (remember: components are directives), `$event` has whatever shape the directive chose to produce.
776
+
If the event belongs to a directive (recall that components are directives), `$event` has whatever shape the directive decides to produce.
778
777
779
778
<a id="eventemitter"></a>
780
779
<a id="custom-event"></a>
781
780
### Custom Events with EventEmitter
782
781
783
782
Directives typically raise custom events with an Angular [EventEmitter](../api/core/index/EventEmitter-class.html).
784
-
A directive creates an `EventEmitter` and exposes it as a property.
785
-
The directive calls `EventEmitter.emit(payload)` to fire an event, passing in a message payload that can be anything.
783
+
The directive creates an `EventEmitter` and exposes it as a property.
784
+
The directives calls `EventEmitter.emit(payload)` to fire an event, passing in a message payload, which can be anything.
786
785
Parent directives listen for the event by binding to this property and accessing the payload through the `$event` object.
787
786
788
787
Consider a `HeroDetailComponent` that presents hero information and responds to user actions.
0 commit comments