Listen for property changes in a object

I know that currently it is possible to add an observer for a property or properties by name. But i need to listen for changes in any property for a given object, without knowing their names.

The use case: in a future, Ember will support query parameters from the URL; in the meantime as a simple workaround, im would like to use a shared Ember.Object between the router and the controller to contain query options. Whenever the controller changes a property in this object (say, by user input), the router would react to this change and reload itself.

Im looking for something like overriding the set function for an individual object (which didnt work), or an event listener maybe? (ive seen that observers use addListener).

Why not capture the query parameters and use them to create an Ember.Object that you pass to controllers as a property of the controller?

Perhaps I’m not understanding your question, but it seems to me that that should work. I’ve done something similar, even though it’s arguably an ill-advised approach.

Thanks for your answer. Passing an Ember.Object is how i finally solved it. The properties of this object are binded to a few form controls, which when changed by the user, should reload the model.

Right now, in Ember docs i cant find anything about how to listen for changes in any/every property of that object. Instead i need to write an explicit list of properties, and add a property observer for each one.

Ive written my use case because i was initially going to ask if it was possible to add this as a built-in Ember feature; but after thinking about it, i could not find another real usage.

It can be done with Observers.

Example can be found:

https://github.com/emberjs/ember.js/blob/v1.7.0/packages/ember-handlebars/lib/controls/select.js#L57-L66