Apologies in advance for adding to the sea of 'mah directive link function isn't called!' posts on Stack Overflow, but none of the solutions seem to work for me.
I have a directive named sgMapHeader nested inside another directive called sgMap. sgMapHeader is not always present, so I append it and compile at sgMap's link time. Both directives share a controller. You can view a simplified version of my issue in this JSBin example.
In an ideal scenario, I would expect two things:
- The inner directive's link function should be executed, logging 'hi there' to the console.
- If I click on the 'hi there' text, 'hold' should be logged as well.
Unfortunately, neither of these expectations are met. I have tried adjusting the scope in different ways, but nothing seems to make a difference. Can anyone point out what I might be missing?