mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
parent
e63ea3f102
commit
4c35682ee5
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ Most developers prefer to format their templates with newlines and indentation t
|
|||
|
||||
```angular-html
|
||||
<section>
|
||||
<h3>User profile</p>
|
||||
<h3>User profile</h3>
|
||||
<label>
|
||||
User name
|
||||
<input>
|
||||
|
|
@ -20,7 +20,7 @@ This template contains whitespace between all of the elements. The following sni
|
|||
|
||||
```angular-html
|
||||
<!-- Total Whitespace: 20 -->
|
||||
<section>###<h3>User profile</p>###<label>#####User name#####<input>###</label>#</section>
|
||||
<section>###<h3>User profile</h3>###<label>#####User name#####<input>###</label>#</section>
|
||||
```
|
||||
|
||||
Preserving the whitespace as written in the template would result in many unnecessary [text nodes](https://developer.mozilla.org/en-US/docs/Web/API/Text) and increase page rendering overhead. By ignoring this whitespace between elements, Angular performs less work when rendering the template on the page, improving overall performance.
|
||||
|
|
|
|||
Loading…
Reference in a new issue