This is a type of bonding that is formed from the from the attraction of oppositely charged ions in a compound.
For instance, MgCl2 is an ionic compound because the 2 positive ions wipossessed by the magnessium atom will attract each of the negtaive ion possessed by each of the chlorine atom to form the magnessium chloride compound
Using the Lewis symbol to demonstrate the bondng:
From the disgram, the negative ions on chlorine atoms will get attracted to the positive ions on the magnessium ion.