-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use signals in chipped content component (#875)
* refactor: use signals in chipped content component * refactor: use signals for internal state
- Loading branch information
Showing
3 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
src/app/resume-page/chipped-content/chipped-content.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<div class="chips"> | ||
@for (content of contents; track content; let i = $index) { | ||
@for (content of contents(); track content) { | ||
<app-chip | ||
[selected]="_isActive && _activeIndex === i" | ||
(selectedChange)="onSelect(i)" | ||
[selected]="isActive() && content === activeContent()" | ||
(selectedChange)="select(content)" | ||
> | ||
{{ content.displayName }} | ||
</app-chip> | ||
} | ||
</div> | ||
<div | ||
class="content" | ||
[@contentDisplayed]="_isActive" | ||
[@contentDisplayed]="isActive()" | ||
(@contentDisplayed.done)="_scrollIntoView(contentElement)" | ||
#contentElement | ||
> | ||
<ng-container | ||
[ngComponentOutlet]="contents[_activeIndex].component" | ||
[ngComponentOutletInputs]="contents[_activeIndex].inputs" | ||
[ngComponentOutlet]="activeContent().component" | ||
[ngComponentOutletInputs]="activeContent().inputs" | ||
></ng-container> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters