Answer:
The principle of momentum conservation states that if there no external force the total momentum of the system before and after the collision is conserved.
Since momentum is a vector, we should investigate the directions and magnitudes of initial and final momentum.
If the first ball hits the second ball with an angle, we should separate the x- and y-components of the momentum (or velocity), and apply conservation of momentum separately on x- and y-directions.