In Bereishit 32:31, Yaakov says, "ראיתי אלוקים פנים אל–פנים" after his encounter with the angel. Most commentators, such as Rashi, interpret that when Yaakov says this, he really meant "I have seen [an angel of] Hashem face to face", but why does the Torah (in which everything is significant) show Yaakov saying he saw Elokim as opposed to a malach of Elokim?
The word elohim means many things. An angel. A judge. A power (i.e. foreign deity). And also at times Hashem, specifically his powerful judgement atribute. The torah does not specify which it means.
Another instance of this usage is two psukim beforehand according to Targum Yonasan on verse 29.
See also parshas Bereishis chapter 6 vs 2 בני האלהים with Rashi.
Even more shocking is the use of Y.H.V.H. to mean the angel Gavriel, see Rashbam parshas Vayeira chapter 18 verse 14.
And see also Shmos 3:4 in the Ibn Ezra at length concerning the word elohim, and that elohim in that passuk is the aforementioned angel. Same idea in the Rashbam there.