Quantcast
Viewing all articles
Browse latest Browse all 4828

How to recompute a Helper when a Model is loaded

@simonc wrote:

Hi,

I’m using ember-i18n in my application and my models have properties like nameEn and nameFr. To provide a generic way to access the name in the current locale, I created a helper to handles this

{{i18n-get myRecord "name" locale}}

if locale is fr it will go fetch nameFr for instance.

It works quite well when myRecord is the route’s model and is loaded but when it’s a promise, it will not recompute when the record is finally loaded.

Is there any way to create a helper that recomputes when one of its arguments is a Model/Promise? I have a hard time finding a solution about this when searching Google.

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4828

Trending Articles