Skip to content

Instantly share code, notes, and snippets.

@isramv
Created February 4, 2015 04:06
Show Gist options
  • Save isramv/891293f1076ae70d713b to your computer and use it in GitHub Desktop.
Save isramv/891293f1076ae70d713b to your computer and use it in GitHub Desktop.
emberjs RESTSerializer example
App.ArticleSerializer = DS.RESTSerializer.extend({
extractArray: function(store, type, payload) {
articles = payload;
data = [];
articles.forEach(function(article) {
tempObj = {
id: article.nid,
title: article.title,
Body: article.Body
};
data.push(tempObj);
});
payload = data;
payload2 = {
articles: data
}
payload = payload2;
return this._super(store, type, payload);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment