Calcium chloride in an ionic compound. The calcium atom loses two electrons, and each chlorine atom gains one electron, to form a full outer shell of electrons. The electrostatic force of attraction between the oppositely charged ions forms an ionic bond, resulting in the formation of calcium chloride, CaCl2.