Created
April 6, 2015 11:42
-
-
Save RyanHirsch/7a86f4a55bc9226fdb40 to your computer and use it in GitHub Desktop.
Ember Spotify Adapters and Serializer
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
// app/album/adapter.js | |
import ApplicationAdapter from '../adapters/application'; | |
export default ApplicationAdapter.extend({ | |
host: 'http://api.spotify.com', | |
namespace: 'v1' | |
}); |
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
// app/adapters/application.js | |
import DS from 'ember-data'; | |
export default DS.RESTAdapter.extend({ | |
}); |
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
// app/album/model.js | |
import DS from 'ember-data'; | |
var attr = DS.attr; | |
export default DS.Model.extend({ | |
name: attr('string'), | |
popularity: attr('number'), | |
release_date: attr('string') | |
}); |
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
// app/album/serializer.js | |
import DS from 'ember-data'; | |
export default DS.RESTSerializer.extend({ | |
extractSingle: function(store, type, payload, id) { | |
return this._super(store, type, { album: payload }, id); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment