I have this setup right now:
App.Workspace = Em.Object.extend({
users: null,
usersChanged: Em.observer('users',function() {
console.log('Users Updated!');
}),
...
initListeners: function() {
var self = this;
someObject.on('someEvent', function() {
...
console.log('before set');
self.set('users', self.store.all('users'));
});
}
});
I only get the output "before set", but not "Users updated!"
What am I missing?
1) Use
to observe RecordArray. Look at jsbin demonstration for you. http://jsbin.com/noxijuloqi/edit?html,js,output
2) Make sure you've injected store into your Object properly, so
self.store
is notundefined
.3) Also you should correct typo
instead