How could Yehoshua be in Yericho? The city is closed
Rashi (from Nedarim 56b): This teaches that the Ibur of a city 1 is considered part of the city.
Ran (56b): This is the [roughly] 70 and two thirds Amos outside the city.
When did Yehoshua approach Yericho?
Radak: After they circumcised the Arelim in Gilgal, they offered Pesach and came to [outside] Yericho.
Why did the angel come to Yehoshua?
Radak: It was to invigorate him to conquer it, and inform him [that he will succeed]. He had a drawn sword
Radak: This is like the angel that came to fight with Yakov, who told him "you fought with an angel and with people, and won!"
Why was he carrying a sword?
Malbim: This indicated that he came regarding the war against Yericho; it will be conquered via the sword.
What is the meaning of "ha'Lanu Atah"?
Rashi: Did you come to help us?
Malbim: Hashem can give (a) a small help (Yisrael must fight, just He will encourage and invigorate them), or (b) a great help (He will kill the enemy; Yisrael will merely plunder the corpses. If you came to go at the front to fight the enemy, you should be facing the enemy! Did you come merely to encourage us