Anger reveals their bad deeds.At that time just leave them or try to distract them.But don't shout and make them angry much.Everything will be alright then.
Babies usually become angry when they can't get their own way. Avoid unnecessary situations that cause anger but ignore the temper tantrum for situations which are unavoidable.