最新のember.jsビルドを使用して、コントローラーアクションを使用してchildViewを作成し、それを現在のビューにプッシュしようとしています。しかし、関連するビューと話す方法がわかりません。
私のsearch.handlebarsで:
<p>Results:</p>
{{#each animal in someResults}}
<li><a {{action showAnimal animal}}>{{animal.species.commonName}}</a></li>
{{/each}}
App.SearchControllerには、次のものがあります。
showAnimal: function(animal) {
// Now what?? The below is obviously wrong
this.animalView = App.AnimalView.create({controller: animal});
var childView = App.SearchView.createChildView(this.animalView);
App.SearchView.get('childViews').pushObject(childView);
}
内部から見えるオブジェクトは次のshowAnimal
とおりです。
animal
- いいよthis.container
-ここで役立つものは何も表示されませんthis.target
-どうやらルーター?
とにかく、私は困惑しています。助けていただければ幸いです。