简体   繁体   中英

setting child view controller emberjs

{{#each posts}}
  {{view App.PostView controller=App.PostController}}
{{/each}}

but this is always getting parentView controller instead of PostController.

I think you miss putting App.PostController between double quotes. The controller have to be an instance, not a class here. So you have to instantiate App.PostController in your js code beafore using it in the template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM