折角（せっかく) is an idiomatic 副詞（ふくし） (adverb) that is often used to express doing something ‘with trouble’, ‘at great pains’, or ‘to be a rare/long-awaited occasion’. Being an adverb that often modifies the meaning of a whole sentence, it will commonly appear at the beginning of a statement. When 折角（せっかく） is nominating an event as being long awaited, it will appear directly before the event, separated only by the 格助詞（かくじょし） (case making particle) の.
I took great trouble to get you the shoes that you wanted, but you gave them to your friend? How inconsiderate.
I went through the trouble to get a day off, but it rained, so my plans were ruined.
Sorry for ruining your long awaited birthday party.
Due to the typhoon, my long awaited vacation has been canceled.
There are several guesses for where 折角（せっかく） originates. One of the most common is that it is an abbreviation for 頭巾（ずきん）の角（つの）を折（お）る ‘to fold the horn (tail) of a hood’. This was something that a famous confucian did intentionally to protect his hood from getting wet in the rain. The people of the time started to copy the act, and 折角（せっかく） also came to be used as an idiom to mean ‘intentionally’, or ‘to go out of one’s way to do something’.