tildeio/conductor.js — pull request #7 by Cyril-sf (2013-04-25 22:28:16+00:00)
Title: API for declaring child cards

A card can contain other cards.

`childCards` is an array of objects describing the differents cards. The accepted attributes are:
* `url` {String} the url of the card
* `id` {String} a unique identifier for this instance (per type)
* `options` {Object} Options passed to `Conductor.load` (optional)
* `data` {Object} passed to `Conductor.loadData`

Example:

Conductor.card({
childCards: [
{ url: '../cards/survey', id: 1 , options: {}, data: '' }
]
});

Any `Conductor.Oasis.Service` needed for a child card can be simply declared with the `services` attribute
A card can contain other cards.

Example:

Conductor.card({
services: {
survey: SurveyService
},
childCards: [
{url: 'survey', id: 1 , options: {capabilities: ['survey']} }
]
});

`loadDataForChildCards` can be defined when a child card needs data passed to the parent card.

Once `initializeChildCards` has been called, the loaded card can be accessed through the `childCards` attribute.

Example:

var card = Conductor.card({
childCards: [
{ url: '../cards/survey', id: 1 , options: {}, data: '' }
]
});

var surveyCard = card.childCards[0].card;