Angular homework: adding error helper function

I forked the class notes repo and brought in the angular_day4 branch, added my change, and made this pull request. I'm comparing it against angular_day4 instead of master to limit how many changes are included in the pull request.