Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Datastore example
MyApp = SC.Application.create({
store: SC.Store.create()
MyApp.MyRecord = SC.Record.extend();
MyApp.resourcePath = "myRecord";
// Load the record and save the storeKey
var storeKey =, {});
// Materialize a record instance
var recordInstance =;
// Determining which record we've got from the resourcePath property
var recordType = recordInstance.constructor.resourcePath;
// This would also work
recordType ='storeKey')).resourcePath;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment