I trying to get a child component (custom input) to update correctly when it is loaded.
I'm basing my approach on this answer: https://stackoverflow.com/a/34814189/386619 and while it works once input is provided, I can't get it to show correctly when it is loaded (with an empty).
The behavior I would like to see is:
Component with empty email address property and Child Component loads, and the child component displays <div>
with message saying Please enter a valid email address.
. Then I type valid input, and it goes away. If I delete it (or provide invalid input) it returns (that part works now).
My plunk (derived from @Thierry Templier's original here): https://plnkr.co/edit/tvQhuvnN4iP2sz0wbzso?p=preview
It's probably something easy, but I'm missing it. I'm also new to TS/JS/NG2/HTML, so I hope this is an easy answer for someone.
I'm using Angular2.RC1.