title: What is the proper way to subscribe to model events in a view?
body: <p>I want to subscribe to the model's becameInvalid and becameError events in my view so I can set some error state. I can think of two ways, both have their drawbacks.</p>
  
  <p>The first way I can think of is to use observers to create my own becameInvalid and becameError hooks on the view:</p>
  
  <pre><code>becameInvalid: function() {
    var isValid = this.get('controller.model.isValid');
    if (Ember.isNone(isValid) || isValid) {
      return;
    }
    console.log('becameInvalid');
  }.observes('controller.model.isValid')
  
  becameError: function() {
    var isError = this.get('controller.model.isError');
    if (Ember.isNone(isError) || !isError) {
      return;
    }
    console.log('becameError');
  }.observes('controller.model.isError')
  </code></pre>
  
  <p>This works, but uses a lot of boilerplate code. The second way I can think of is to add handlers to the events after the model is loaded:</p>
  
  <pre><code>didLoad: function() {
    var isLoaded = this.get('controller.model.isLoaded');
    if (Ember.isNone(isLoaded) || !isLoaded) {
      return;
    }
    var model = this.get('controller.model');
    model.on('becameInvalid', function() {
      console.log('becameInvalid');
    });
    model.on('becameError', function() {
      console.log('becameError');
    });
  }.observes('controller.model.isLoaded')
  </code></pre>
  
  <p>The problem with this approach is that it still requires some boilerplate code and (correct me if I'm wrong) the event handlers won't be cleaned up automatically when the view is removed.</p>
  
  <p>What I'd like to do is something similar to the observers protocol for events that would be cleaned up automatically by the framework. E.g.:</p>
  
  <pre><code>becameInvalid: function() {
    console.log('becameInvalid');
  }.eventHandler('controller.model.becameInvalid')
  
  becameError: function() {
    console.log('becameError');
  }.eventHandler('controller.model.becameError')
  </code></pre>
  
  <p>Does something like this exist?</p>