fix template-syntax comments
This commit is contained in:
parent
d398150573
commit
b1aae7f306
|
@ -1389,29 +1389,29 @@ block style-property-name-dart-diff
|
||||||
这都是好事。
|
这都是好事。
|
||||||
|
|
||||||
//
|
//
|
||||||
:marked
|
:marked
|
||||||
### Event bubbling and propagation [TODO: reinstate this section when it becomes true]
|
### Event bubbling and propagation [TODO: reinstate this section when it becomes true]
|
||||||
Angular invokes the event-handling statement if the event is raised by the current element or one of its child elements.
|
Angular invokes the event-handling statement if the event is raised by the current element or one of its child elements.
|
||||||
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-bubbling')(format=".")
|
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-bubbling')(format=".")
|
||||||
:marked
|
:marked
|
||||||
Many DOM events, both [native](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Overview_of_Events_and_Handlers ) and [custom](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events ), bubble up their ancestor tree of DOM elements until an event handler along the way prevents further propagation.
|
Many DOM events, both [native](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Overview_of_Events_and_Handlers ) and [custom](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events ), bubble up their ancestor tree of DOM elements until an event handler along the way prevents further propagation.
|
||||||
|
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
:marked
|
:marked
|
||||||
`EventEmitter` events don’t bubble.
|
`EventEmitter` events don’t bubble.
|
||||||
|
|
||||||
:marked
|
:marked
|
||||||
The result of an event binding statement determines whether
|
The result of an event binding statement determines whether
|
||||||
[event propagation](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Examples#Example_5:_Event_Propagation)
|
[event propagation](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Examples#Example_5:_Event_Propagation)
|
||||||
continues or stops with the current element.
|
continues or stops with the current element.
|
||||||
|
|
||||||
Event propagation stops if the binding statement returns a falsey value (as does a method with no return value).
|
Event propagation stops if the binding statement returns a falsey value (as does a method with no return value).
|
||||||
Clicking the button in the next example triggers a save;
|
Clicking the button in the next example triggers a save;
|
||||||
the click doesn't make it to the outer `<div>` so the div's save handler is not called.
|
the click doesn't make it to the outer `<div>` so the div's save handler is not called.
|
||||||
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-no-propagation')(format=".")
|
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-no-propagation')(format=".")
|
||||||
:marked
|
:marked
|
||||||
Propagation continues if the statement returns a truthy value. In the next example, the click is heard by both the button
|
Propagation continues if the statement returns a truthy value. In the next example, the click is heard by both the button
|
||||||
and the outer `<div>`, causing a double save.
|
and the outer `<div>`, causing a double save.
|
||||||
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-propagation')(format=".")
|
+makeExample('template-syntax/ts/app/app.component.html', 'event-binding-propagation')(format=".")
|
||||||
|
|
||||||
#two-way
|
#two-way
|
||||||
|
|
Loading…
Reference in New Issue