When working with a nested (DOM like) view structure, you need a way get to child view instances. FruitMachine has three APIs for this:
Returns a single descendant View instance by module type. Similar to Element.prototype.querySelector
.
apple.module('orange');
//=> orange
Returns a list of descendant View instance by module type. Similar to Element.prototype.querySelectorAll
.
apple.modules('orange');
//=> [orange, orange, ...]
Returns a single descendant View instance by id. Similar to document.getElementById
.
apple.id('my_orange_1');
//=> orange