How to change items in array property and render the change?

item.caption = obj.caption

Assertion Failed: You must use Ember.set() to set the caption property (of [object Object]) to Program Manager.

and i do not know how to make it work with set :slight_smile:

I provide a simple sample code.

Please take a look for getting idea : here

made it as:

Ember.set(item, 'caption', obj.caption);  
Ember.set(item, 'application', obj.application); 

that worked, many thanks!!!

could you also please help me with other interesting issue described here:


ps: is it possible to observe both clientList.@each.caption and clientList.@each.application in the same computed property?

You’re welcome.

I see that issue and unfortunately I can’t help. I didn’t work with phonix.

Yes. it’s like this : clientList.@each.{caption, application}

Note that actually computed property in this answer is not necessary. You can use that clientList in template. It is just for usage in another situation might needed

one more question in terms of this case: how to render item delete from the array? (keeping working clientList.@each.{caption,application} )

i’m done with



one more question from ember novice - what are the pros\cons of using a model (for the clientList) instead of an objects array ?

What do you mean?

Model is an entity in your system. It’s persistent and usually in a db persisted.

aha, so we use models of ember data for data stored in db and it’s ok to use objects on-the-fly to render data that does not need to be stored in a db. correct?

Yeah. You can use any type of object you want

ok, makes sense… :

Models tend to be persistent. That means the user does not expect model data to be lost when they close their browser window. To make sure no data is lost, if the user makes changes to a model, you need to store the model data somewhere that it will not be lost.

Thank you!

You can change the ‘this’ context with Function.bind(thisContext)!

x.forEach(function() { this.set(…); }.bind(this));