mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
committed by
Jessica Janiuk
parent
561cb1d8da
commit
eb44643bdf
@@ -72,9 +72,9 @@ common use cases include:
|
||||
- Measuring element geometry, such as with `getBoundingClientRect`
|
||||
- Reading an element's text content
|
||||
- Setting up native observers such
|
||||
as `[MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)`,
|
||||
`[ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)`, or
|
||||
`[IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)`.
|
||||
as [`MutationObserver`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver),
|
||||
[`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver), or
|
||||
[`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
|
||||
|
||||
Avoid inserting, removing, and modifying DOM elements. In particular, **never directly set an
|
||||
element's `innerHTML` property**, which can make your application vulnerable
|
||||
|
||||
@@ -43,7 +43,7 @@ Other common examples of event listeners include:
|
||||
|
||||
### $event
|
||||
|
||||
If you need to access the [event]([Event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Event)) object, Angular provides an implicit `$event` variable that you can be pass to a function:
|
||||
If you need to access the [event](https://developer.mozilla.org/en-US/docs/Web/API/Event) object, Angular provides an implicit `$event` variable that you can be pass to a function:
|
||||
|
||||
```html
|
||||
<button (click)="createUser($event)">Submit</button>
|
||||
|
||||
Reference in New Issue
Block a user