IgeObject

Method: parent

Returns the object's parent object (the object that it is mounted to).
parent (String id)
  • Stringid Optional, if present will scan up the parent chain until a parent with the matching id is found. If none is found, returns undefined.
Returns *

Get the object parent

// Create a couple of entities and give them ids
var entity1 = new IgeEntity().id('entity1'),
    entity2 = new IgeEntity().id('entity2');

// Mount entity2 to entity1
entity2.mount(entity1);

// Get the parent of entity2 (which is entity1)
var parent = entity2.parent();

// Log the parent's id (will output "entity1")
console.log(parent.id());
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point