What is a dehydrated detector and how am I using one here? : <p>I'm using a simple directive to focus a text input when the element is active using <code>*ngIf</code>. This is contained within a <code>*ngFor</code> loop.</p>

<p>When the first <code>*ngIf</code> is activated, the input focuses as expected. When another input is activated I get the error:</p>

<p><code>EXCEPTION: Attempt to use a dehydrated detector.</code></p>

<p>I don't understand what this means and how I can prevent the error. The functionality still works even with the error.</p>

<pre><code>@Directive({
    selector: '[myAutoFocus]'
})
export class AutoFocusDirective {
    constructor(private elem: ElementRef) {
        window.setTimeout(function() {
            elem.nativeElement.querySelector('input').focus();
        });
    }
}
</code></pre>

<p>```</p>
