title: ember select change model property only on button click
body: <p>I have an ember <code>Select</code> that is bound to a property of the model in a modal dialog.</p>
  
  <p>I want the model property to change only if the user clicks OK (and gets reverted if he clicks cancel).</p>
  
  <p>How can I do that?</p>
  
  <p>edit-session-modal.hbs:  </p>
  
  <pre><code>{{#modal-dialog title='Change status (select empty to return to original status)' ok='save' close='closeModal'}}
      &lt;form {{action 'ok' on='submit' target=view}}&gt;
          &lt;div class="form-group"&gt;
              &lt;label&gt;Status&lt;/label&gt;
            {{view "select" content=sessionStatuses selection=model.status}}
          &lt;/div&gt;
      &lt;/form&gt;
  {{/modal-dialog}}
  </code></pre>
  
  <p>controllers/edit-session-modal.js:</p>
  
  <pre><code>import Ember from 'ember';
  
  export default Ember.Controller.extend({
    actions: {
      close: function() {
        return this.send('closeModal');
      }
    },
    sessionStatuses: ['', 'SUCCESS', 'FAILURE', 'RUNNING'],
    selectedStatus: "model.status"
  });
  </code></pre>