Created
May 14, 2016 17:45
-
-
Save visualjeff/fd0707201fe0e97dcaac1e719354425e to your computer and use it in GitHub Desktop.
Ember-data override to pull out meta data from a particular data type. Note this is a findAll override. So we're pulling back a collection of locations.
This file contains hidden or 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
normalizeFindAllResponse(store, primaryModelClass, payload, id, requestType) { | |
if (primaryModelClass.modelName === 'location') { // My data model in this case is location. | |
if (payload && payload.hasOwnProperty('meta')) { | |
let meta = payload.meta; | |
//Store / persist or do something your meta data. | |
delete payload.meta; | |
} | |
} | |
return this._super(...arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment