Max Heiber
Feb 24, 2017 · 1 min read

This article **rules**: my colleagues and I couldn’t find any docs on testing FormBuilder stuff, so this saved us a lot of time. Thank you!

I noticed that on lines 30–32 of login.component.ts, you’re manually keeping this.formValidin sync with this.loginForm.valid. Could you do away with this and just use this.loginForm.valid? In general, it’s best to avoid duplicating state and manually syncing it, but I don’t know ng2 well enough to know if there’s a reason for it in this case.

    Max Heiber

    Written by

    Views are my own

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade