How-to say “on the way” with がけに
Pre-ます-Form (Going) VERB + がけに as “on the way of VERBing, ～”
The phrasing がけに can be inserted directly after the Pre-ます-Form of what is considered a “going” type VERB word (e.g. 行く, 帰る, くる) to modify its meaning to be “on the way of VERBing.” In this usage, がけに is typically seen written in kana form.
Pre-ます-Form (Going) VERB + がけに
Kigake ni jibun no shippo o oikakeru inu o mimashita.
“On the way (coming) here, I saw a dog that was chasing its own tail.”
Koukousei no koro wa, gakkou e no ikigake ni konbini kara croquette o katta.
“When I was a high schooler, on the way (going) to school I would stop by the convenience store and buy croquettes.”
Kyou, kaerigake ni atarashiku ninki na crepe mise ni yoru tsumori da.
“Today I plan on stopping by that new, popular crepe store on the way returning home.”