> It would be in the template (partial html) of the contextmenu.

Ok, understood.

> Would this be possible?

Yep, I guess that's possible. But such a directive would need a reference to the map. I would find such a directive a bit overkill. Much easier and less fuzzy to register the map contextmenu listener from within the directive's link function IMO.