コンセントを接続すると、ルータは、提供されたものと同じ名前のコントローラとビューの両方を探します。リストした例では、ルーターはFooControllerとFooViewを探していますが、コントローラーを見つけていません。詳細を指定する場合は、次のように、ビュー、コントローラー、およびコンテキストを含むオプションオブジェクトを渡すことができます。
router.get('applicationController').connectOutlet( {
outletName: 'master',
controller: 'fooController',
view: 'fooView',
context: data
});
ドキュメントから:
connectOutlet: function(name, context) {
// Normalize arguments. Supported arguments:
//
// name
// name, context
// outletName, name
// outletName, name, context
// options
//
// The options hash has the following keys:
//
// name: the name of the controller and view
// to use. If this is passed, the name
// determines the view and controller.
// outletName: the name of the outlet to
// fill in. default: 'view'
// viewClass: the class of the view to instantiate
// controller: the controller instance to pass
// to the view
// context: an object that should become the
// controller's `content` and thus the
// template's context.
編集:文法とコード形式