I am using Angular with Bootstrap. Here is the code for reference:
Use Bootstrap's "error" class for styling. You can write less code.
Name Required
EDIT: As other answers and comments point out - in Bootstrap 3 the class is now "has-error", not "error".