staugaard/sproutcore-resource — Issue #22: Observers are not firing on property changes
Author: rykov
Created: 2011-11-29 01:20:01+00:00
State: open

I see that SC.Resource is an extension of SC.Object, however, it doesn't look like it's respecting observers. Is this by design?

As a demo, here is some test code:

var A = SC.Object.extend({ name: null });
var B = SC.Resource.define({
url: '/b', schema: { name: String }
});

var a = A.create({
obs: function() { SC.Logger.info("A!!!"); }.observes('name')
});

var b = B.create({
obs: function() { SC.Logger.info("B!!!"); }.observes('name')
});

a.set('name', 'Foo');
b.set('name', 'Bar');

This code produces the following output:

A!!!

The observer in the SC.Resource is not fired.