ef4/ember-elsewhere

Binding issue

sevab opened this issue · 2 comments

sevab commented

I have a route where model is bound to a query param (in my case a category_id). As I change the underlying category model within this route, elsewhere fails to send fresh data (category.title in this case) to the underlying component navbar-title, and the content remains stale. The data does update in the next render, but with the previous model's state instead of the current.

Updates in the next render with last model's data
{{to-elsewhere named='nav-title' send=(component 'navbar-title' title=category.title}}

Updates immediately with current data
{{log category.title}}

sevab commented

Possibly related to emberjs/ember.js#13061

From the comments there tried passing same data via hash as a workaround and it works, but adds a lot of unnecessary complications. A previously simple {{#from-elsewhere name='nav-title'}}, becomes

{{#from-elsewhere name='nav-title' as |c|}}
  {{#if c}}
    {{navbar-title title=c.title}}
  {{/if}}
{{/from-elsewhere}}
ef4 commented

Thanks for reporting this, I haven't had a chance to dig in but it does seem like a real bug.