show/hide password text using angular2
<p>i want to show/hide the password text based on the user click. But i am getting the following error saying:</p>

<p><a href="https://i.stack.imgur.com/qjwuH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qjwuH.png" alt="enter image description here"></a></p>

<pre><code>export class App {
    password = "secret";
    show = false;

    @ContentChild(ShowHideInput) input: ShowHideInput;

    constructor(){}

    toggleShow()
    {
        this.show = !this.show;
        console.log(this.input); //undefined
        if (this.show){
            this.input.changeType("text");
        }
        else {
            this.input.changeType("password");
        }
    }
}
</code></pre>

<p>The following plunker link which i have created.</p>

<pre><code>https://plnkr.co/edit/2GK79PuPtRQNmoUbF6xC?p=preview
</code></pre>