ApplicationController ですべてのユーザーのリストを初期化し、別のビューのドロップダウンに表示したいと思います。異なるビューから ApplicationController にアクセスするにはどうすればよいですか?
関連するコードは次のとおりです。
App.ApplicationRoute = Ember.Route.extend({
setupController:function(controller) {
controller.set('users', App.User.find());
controller.set('selectedUser', null);
}
});
<script type="text/x-handlebars" data-template-name="users">
{{view Ember.Select
contentBinding="App.ApplicationController.users"
optionValuePath="content.id"
optionLabelPath="content.fullName"
selectionBinding="App.ApplicationControllerselectedUser"}}
selected user: {{App.ApplicationController.selectedUser.fullName}}
</script>