-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observer on property in parentView.parentView not working #3693
Comments
In general, these sorts of |
I already had a jsbin attached, here's the jsfiddle: http://jsfiddle.net/66qux/. This is the commit that introduced the regression: d4fd799 I know this is not an idiomatic use of observers, but it's a pattern we often use to build complex reusable views (our app is basically a SproutCore 1.4 app ported to Ember using Flame). To give an example, if I declare the following view: App.ComplexView = Flame.View.extend({
childViews: 'contentView'.w(),
label: '',
button: '',
contentView: Flame.View.extend({
childViews: 'labelView buttonView'.w()
labelView: Flame.LabelView.extend({
// Looks cumbersome and fragile, but in Flame we can achieve the
// same using Flame.computed.nearest('label')
value: Em.computed.alias('parentView.parentView.label')
}),
buttonView: Flame.ButtonView.extend({
title: Em.computed.alias('parentView.parentView.button')
})
})
}); I can then use it without having to care about its complex structure: App.ComplexView.create({
label: 'foo',
button: 'bar'
}) The way Ember currently works, changing the Debugging this I noticed that when the |
Whoops. I missed the JSBin. Sorry! |
@kselden This is related to your work. It still seems like it should work but maybe you will notice something I'm missing. |
@krisselden ping. |
@ctimmerm I did give feedback, I reviewed the jsbin, |
To further clarify, it should be finishing chains from the nodes in its meta.chainWatchers, not starting at meta.chains. |
fixed in #5575 |
Observing a property more than one level up in the parentView chain does not seem to work. This used to work in earlier release candidates.
jsbin
Ember.meta(App.view) shows that there are no chainWatchers and
watching.test
is undefined.The text was updated successfully, but these errors were encountered: