Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(list): update active item on every navigation #22

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

patrickjahr
Copy link
Collaborator

No description provided.

@patrickjahr patrickjahr marked this pull request as ready for review April 16, 2024 11:03
const active = this.activatedUrl()?.includes(this.itemId());
protected readonly updateActiveItemId = effect(() => {
const id = untracked(this.itemId);
const active = this.activatedUrl()?.includes(id);
if (active) {
setTimeout(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe afterNextRender is clearer here https://angular.io/api/core/afterNextRender#example

@patrickjahr patrickjahr merged commit 8d1e840 into main Apr 16, 2024
1 check passed
@patrickjahr patrickjahr deleted the fix/list-routing branch April 16, 2024 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants