Even though parents get angry, they must control their behavior. The louder they get, the quieter you get. Nothing is learned or gained at the point of crisis. To teach a lesson, you and your child must be calm and alert. When anger takes over, logic goes by the wayside.
Anger can be a secondary emotion.
The underlying cause may be fear or pain or guilt. Try to get to the cause. Anger can cause huge gaps in the best of relationships. Think before you act. Consider what you want your child to learn from the situation.