Skip to content

Commit a8dac3d

Browse files
committed
chore(app): refactor header to 'GitHub' navigation to use ng-template for improved reusability
1 parent ea17142 commit a8dac3d

1 file changed

Lines changed: 24 additions & 18 deletions

File tree

src/app/shared/components/header/header.component.html

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,27 @@
2929
</div>
3030
</ng-template>
3131

32+
<ng-template #githubNavItem>
33+
<!-- GITHUB -->
34+
<div class="nav__item">
35+
<a
36+
class="nav__link"
37+
href="https://github.com/Ismaestro/angular-example-app"
38+
target="_blank"
39+
>
40+
<img
41+
class="github-logo__image"
42+
ngSrc="angularexampleapp/assets/icons/github-mark-white_nkewl9.png"
43+
alt="github logo"
44+
i18n-alt
45+
height="32"
46+
width="32"
47+
priority
48+
/>
49+
</a>
50+
</div>
51+
</ng-template>
52+
3253
<!-- HOME -->
3354
<div class="nav__item">
3455
<a
@@ -72,24 +93,7 @@
7293
</a>
7394
</div>
7495

75-
<!-- GITHUB -->
76-
<div class="nav__item">
77-
<a
78-
class="nav__link"
79-
href="https://github.com/Ismaestro/angular-example-app"
80-
target="_blank"
81-
>
82-
<img
83-
class="github-logo__image"
84-
ngSrc="angularexampleapp/assets/icons/github-mark-white_nkewl9.png"
85-
alt="github logo"
86-
i18n-alt
87-
height="32"
88-
width="32"
89-
priority
90-
/>
91-
</a>
92-
</div>
96+
<ng-container [ngTemplateOutlet]="githubNavItem" />
9397

9498
<div class="nav__item">
9599
<app-language-selector />
@@ -113,6 +117,8 @@
113117
</a>
114118
</div>
115119

120+
<ng-container [ngTemplateOutlet]="githubNavItem" />
121+
116122
<!-- SEARCH -->
117123
<div class="nav__item">
118124
<app-pokemon-search-input />

0 commit comments

Comments
 (0)