Created
February 4, 2015 04:06
-
-
Save isramv/891293f1076ae70d713b to your computer and use it in GitHub Desktop.
emberjs RESTSerializer example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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