Skip to content

Commit 143883a

Browse files
MeAkibAndrewKushnir
authored andcommitted
docs(docs-infra): use self-closing syntax for component examples
Replaced multiple component tags such as `<example></example>` with self-closing syntax (`<example />`) across documentation examples. This improves readability and aligns with the current Angular style conventions. (cherry picked from commit a2cd367)
1 parent b8972da commit 143883a

File tree

14 files changed

+34
-34
lines changed

14 files changed

+34
-34
lines changed

adev/src/content/examples/dependency-injection/src/app/app.component.1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {HeroesComponent} from './heroes/heroes.component';
77
selector: 'app-root',
88
template: `
99
<h1>{{title}}</h1>
10-
<app-car></app-car>
11-
<app-heroes></app-heroes>
10+
<app-car />
11+
<app-heroes />
1212
`,
1313
imports: [CarComponent, HeroesComponent],
1414
})

adev/src/content/examples/dependency-injection/src/app/app.component.2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {HeroesComponent} from './heroes/heroes.component';
88
selector: 'app-root',
99
template: `
1010
<h1>{{title}}</h1>
11-
<app-car></app-car>
12-
<app-heroes></app-heroes>
11+
<app-car />
12+
<app-heroes />
1313
`,
1414
imports: [CarComponent, HeroesComponent],
1515
})

adev/src/content/examples/dependency-injection/src/app/heroes/heroes-tsp.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {HeroListComponent} from './hero-list.component';
1111
selector: 'app-heroes-tsp',
1212
template: `
1313
<h2>Heroes</h2>
14-
<app-hero-list></app-hero-list>
14+
<app-hero-list />
1515
`,
1616
imports: [HeroListComponent],
1717
})

adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {HeroListComponent} from './hero-list.component';
88
providers: [HeroService],
99
template: `
1010
<h2>Heroes</h2>
11-
<app-hero-list></app-hero-list>
11+
<app-hero-list />
1212
`,
1313
imports: [HeroListComponent],
1414
})

adev/src/content/examples/dependency-injection/src/app/heroes/heroes.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {HeroListComponent} from './hero-list.component';
88
providers: [heroServiceProvider],
99
template: `
1010
<h2>Heroes</h2>
11-
<app-hero-list></app-hero-list>
11+
<app-hero-list />
1212
`,
1313
imports: [HeroListComponent],
1414
})

adev/src/content/examples/pipes/src/app/app.component.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ <h1 id="toc">Pipes</h1>
1111

1212
<hr>
1313
<h2 id="date-pipe">Date Pipe</h2>
14-
<app-birthday></app-birthday>
14+
<app-birthday />
1515

1616
<hr>
1717
<h2 id="date-pipe-formatting">Date Pipe Formatting</h2>
18-
<app-birthday-formatting></app-birthday-formatting>
18+
<app-birthday-formatting />
1919

2020
<hr>
2121
<h2 id="pipe-chaining">Pipe Chaining</h2>
22-
<app-birthday-pipe-chaining></app-birthday-pipe-chaining>
22+
<app-birthday-pipe-chaining />
2323

2424
<hr>
25-
<app-power-booster id="power-booster"></app-power-booster>
25+
<app-power-booster id="power-booster" />
2626

2727
<h2 id="pipe-precedence">Pipes and Precedence</h2>
28-
<app-pipe-precedence></app-pipe-precedence>
28+
<app-pipe-precedence />
2929

3030
<hr>
31-
<app-hero-async-message id="hero-async-message"></app-hero-async-message>
31+
<app-hero-async-message id="hero-async-message" />
3232

3333
<hr>
3434
<h2 id="json-pipe">Json Pipe for Debugging</h2>
3535
<p>Use the JsonPipe to display component properties for debugging.</p>
3636
<code>data | json</code>
3737
<p>
38-
<app-json-pipe></app-json-pipe>
38+
<app-json-pipe />
3939
</p>
4040

4141
<hr>
42-
<app-flying-heroes id="flying-heroes"></app-flying-heroes>
42+
<app-flying-heroes id="flying-heroes" />
4343

4444
<hr>
45-
<app-flying-heroes-impure id="flying-heroes-impure"></app-flying-heroes-impure>
45+
<app-flying-heroes-impure id="flying-heroes-impure" />

adev/src/content/examples/resolution-modifiers/src/app/app.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ <h1>DI resolution modifiers</h1>
33
<p>Basic flower service: {{ flower.emoji }}</p>
44
<p>Basic leaf service: {{ leaf.emoji }}</p>
55

6-
<app-optional></app-optional>
6+
<app-optional />
77

8-
<app-self></app-self>
8+
<app-self />
99

10-
<app-self-no-data></app-self-no-data>
10+
<app-self-no-data />
1111

12-
<app-skipself></app-skipself>
12+
<app-skipself />
1313

14-
<app-host-parent></app-host-parent>
14+
<app-host-parent />

adev/src/content/examples/resolution-modifiers/src/app/host/host.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<h2>&commat;Host() Component</h2>
33
<p>Flower emoji: {{ flower?.emoji }}</p>
44
<p><i>(&commat;Host() stops it here)</i></p>
5-
<app-host-child></app-host-child>
5+
<app-host-child />
66
</div>

adev/src/content/examples/router-tutorial/src/app/app.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ <h1>Angular Router Sample</h1>
1919
</nav>
2020
<!-- #enddocregion routeractivelink-->
2121
<!-- #docregion router-outlet -->
22-
<router-outlet></router-outlet>
22+
<router-outlet />
2323
<!-- #enddocregion router-outlet -->
2424

2525
<div style="display: none;">
2626
<!-- This HTML represents the initial state for the tutorial. It is not intended to appear in the app. -->
2727
<!-- #docregion setup, components -->
28-
<app-crisis-list></app-crisis-list>
29-
<app-heroes-list></app-heroes-list>
28+
<app-crisis-list />
29+
<app-heroes-list />
3030
<!-- #enddocregion setup, components -->
3131

3232
<!-- This HTML snippet is for when the user first adds the routerlink navigation. -->
@@ -38,4 +38,4 @@ <h1>Angular Router Sample</h1>
3838
<!-- #enddocregion nav-->
3939

4040

41-
</div>
41+
</div>

adev/src/content/examples/router/src/app/app.component.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ <h1>Angular Router</h1>
44
<a routerLink="/crisis-center" routerLinkActive="active" ariaCurrentWhenActive="page">Crisis Center</a>
55
<a routerLink="/heroes" routerLinkActive="active" ariaCurrentWhenActive="page">Heroes</a>
66
</nav>
7-
<router-outlet></router-outlet>
7+
<router-outlet />

0 commit comments

Comments
 (0)