Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Keep computed value while reloading data

$
0
0

@ondrejsevcik wrote:

Hi, I have a simple computed property that returns name from my user model. The problem is when the model is being reloaded, the value is empty for a moment. Is there a way to keep the old value till the new one is loaded?

// Computed property
userName: computed.alias('model.name')

// In template than super simple 
<h1>{{userName}}</h1>

// But when I do in code
model.reload();

// Then I get for a few milliseconds (basically it blinks) before the name is loaded again
<h1></h1>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles