emberjs / emberjs/ember.js

link-to doesn't update the href on promised models

Open
#17,060 3 comments 1 reaction 0 assignees View on GitHub
Has Reproduction Needs Bug Verification Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

If the model given to a `{{link-to}}` helper is a promise (eg. DS.PromiseObject) the helper doesn't update the href once the Promise is fullfiled (which might change the result of the `serialize()` hook of the desired Route).

[example](https://ember-twiddle.com/162bcaca1298fedad9a1ef7ad4e23ad6)
1. The link is not on a loading state and shows an incorrect url
2. If the promise resolves the href is not updated

Once the link is clicked the new url is the correct one and the rerender of the components puts the correct value on the href of the link.

Is this the expected outcome?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.