There are old traditions about the angels before the creation of Adam. According to Ibn Qatadah, it was said that the angels were informed about the creation of Adam and his progeny by the jinn who lived before Adam. 'Abdullah Ibn 'Umar said that the jinn had existed for about two thousand years before Adam and then shed blood. Therefore, Allah sent on them an army of angels that drove them out to the depths of the seas. Thn Abi Hatim narrated from Ali Jafar Al-Baqer that the angels were informed that man would cause wickedness and shed blood on earth. It was also said that they knew that no one would be created on earth who would not be wicked and shed blood.
Whether or not these traditions are correct, the angels did understand that Allah would create a vicegerent on earth. Allah the Almighty announced that He was going to create a human being out of clay, that He would mold him and blow His spirit into him, and then the angels should prostrate before him.