How to invalidate `<input>`s internal state?
<p>Assume I have a simple input in <code>ember.js</code>:</p>

<pre><code>&lt;input value={{val}} /&gt;
</code></pre>

<p>And then enter text there. How can I enforce ember to reset the <code>&lt;input&gt;</code> <em>to the same value</em> with code?</p>

<p>A simple <code>this.notifyPropertyChange('val');</code> or <code>set(this, 'val', get(this, 'val'));</code> does <em>not</em> work.</p>

<p>You have to do something like this:</p>

<pre><code>let oldVal = get(this, 'val');
set(this, 'val', 'some dummy value');
Ember.run.later(() =&gt; set(this, 'val', oldVal));
</code></pre>

<p>But thats really hacky.</p>

<hr>

<p>Let me explain why I need this. One example is an input where the user may only enter the letters <code>A</code> and <code>B</code>, but not <code>C</code>. It would be nice to do something like this:</p>

<p><em>hbs</em>:</p>

<pre><code>&lt;input value={{val}} oninput={{action 'update' value='target.value'}} /&gt;
</code></pre>

<p><em>js</em>:</p>

<pre><code>val: '',
actions: {
    update(newVal) {
        if(!newVal.includes('C')) {
            set(this, 'val', newVal);
        } else {
            // reset the input to the last valid value.
            // so basically do
            set(this, 'val', get(this, 'val'));
            // or
            this.notifyPropertyChange('val');
            // but neither does update the &lt;input&gt;.
            // the only way is this:
            let oldVal = get(this, 'val');
            set(this, 'val', 'some dummy value');
            Ember.run.later(() =&gt; set(this, 'val', oldVal));
            // because this enforces the &lt;input&gt; to forget its internal state.
            // is there any other way to do this?
        }
    }
}
</code></pre>