Compounds with 2 ions bonded are called ionic compounds.
They are held together by the attractions between the positive and negative ions.