getReference (type, id) RecordReference
Get the reference for the specified record.
Example
var userRef = store.getReference('user', 1); // check if the user is loaded var isLoaded = userRef.value() !== null; // get the record of the reference (null if not yet available) var user = userRef.value(); // get the identifier of the reference if (userRef.remoteType() === "id") { var id = userRef.id(); } // load user (via store.find) userRef.load().then(...) // or trigger a reload userRef.reload().then(...) // provide data for reference userRef.push({ id: 1, username: "@user" }).then(function(user) { userRef.value() === user; });
Parameters:
-
type
String
-
id
String|Integer
Returns:
-
RecordReference
Please login to continue.