[repost ]How to represent arrays within ember-data models?
original:http://ift.tt/1tXCki8 Answer: Well… It was a little bit difficult but mixing all answers in this post I made it work. Firstly, you should create a transform for the new type “array”: DS.ArrayTransform = DS.Transform.extend({ deserialize: function(serialized) { return (Ember.typeOf(serialized) == "array") ? serialized : []; }, serialize: function(deserialized) { var type = Ember.typeOf(deserialized); if (type […]
via WordPress http://ift.tt/1A5pwmh
via WordPress http://ift.tt/1A5pwmh
Labels: hanhuiwen
0 Comments:
Post a Comment
<< Home