I have a view class called App.BlockView. It has a property called selected and clicking on this view toggles the selected property.
When I capture certain events such as clicking on the background of the container, I want to set selected property to false on all the views (or those which have it set to true). Is there any way in ember to collect all instances of a view class — regardless of where and how they are instantiated — and set a property on them?
Note that my views are created in handlebars template like {{View App.BlockView}} and therefore I don’t keep a reference to them.
You can have views register and unregister themselves on the class to accomplish this. e.g.