mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
committed by
Andrew Kushnir
parent
e63ea3f102
commit
4c35682ee5
@@ -8,7 +8,7 @@ Most developers prefer to format their templates with newlines and indentation t
|
|||||||
|
|
||||||
```angular-html
|
```angular-html
|
||||||
<section>
|
<section>
|
||||||
<h3>User profile</p>
|
<h3>User profile</h3>
|
||||||
<label>
|
<label>
|
||||||
User name
|
User name
|
||||||
<input>
|
<input>
|
||||||
@@ -20,7 +20,7 @@ This template contains whitespace between all of the elements. The following sni
|
|||||||
|
|
||||||
```angular-html
|
```angular-html
|
||||||
<!-- Total Whitespace: 20 -->
|
<!-- 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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user