Skip to content

Instantly share code, notes, and snippets.

@bmavity
Created April 2, 2010 06:17
Show Gist options
  • Save bmavity/352827 to your computer and use it in GitHub Desktop.
Save bmavity/352827 to your computer and use it in GitHub Desktop.
ioc.register('parent', function(child, sampleDomElement) {
return {
sayHello: function() {
sampleDomElement.innerHTML = '<h1>Hi There</h1>';
child.doIt(sampleDomElement);
}
};
});
ioc.register('child', function() {
return {
doIt: function(domElement) {
domElement.innerHTML += '<p>From me too!</p>';
}
};
});
ioc.resolve('parent').sayHello();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment