Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to convert Ember Object into plain javascript object?

I could not find any way to accomplish the task of such conversion as I could not find any means of getting Ember.js properties for the object. Ember.keys returns only the properties I set in create or with get and the properties declared in Ember.extend do not show up there. I use such properties to set up default values (e.g. [] for array properties)

like image 316
Qrilka Avatar asked Feb 21 '13 11:02

Qrilka


1 Answers

Here is my dirty workaround

var newModel = JSON.parse(JSON.stringify(model));
like image 198
user10078 Avatar answered Oct 24 '22 05:10

user10078