Skip to content

Instantly share code, notes, and snippets.

@ziad-saab
Created June 20, 2014 21:45
Show Gist options
  • Save ziad-saab/4f2ec20cd693330e1f78 to your computer and use it in GitHub Desktop.
Save ziad-saab/4f2ec20cd693330e1f78 to your computer and use it in GitHub Desktop.
Parse.com and ExtJS 5 base model
Ext.define('MyApp.model.Base', {
extend: 'Ext.data.Model',
fields: [
{
name: 'objectId',
type: 'string'
}
],
schema: {
namespace: 'MyApp.model',
proxy: {
type: 'rest',
url: 'https://api.parse.com/1/classes/{entityName}',
reader: {
type: 'json',
rootProperty: 'results'
},
headers: {
'X-Parse-Application-Id': 'XXX',
'X-Parse-REST-API-Key': 'XXX'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment