0
votes

Is it possible to copy an object from the controller "content"?

I've tried adding Ember.Copyable mixin in the model :

App.Template = Ember.Object.extend(Ember.Copyable, {
   id : "0",
   title : "test"
}

In my controller I would like to copy the model that has been injected in the route.

this.set('datas',Ember.copy(this.get('content'));

I get this error when data-binding the datas object :

Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM.

Can you provide an answer without using ember-data ?

1
Could it be that the "content" has not loaded yet ? - kris

1 Answers

2
votes

I believe you'll need to implement the copy method yourself as per Ember.Copyable.

Here's an example http://emberjs.jsbin.com/lekox/3/edit