I'm trying to create a directive which would dynamically add content of template into DOM. Just like angular-datePicker does.
I would like to have such a directive as an attribute directive. I would use it for example for button. When button is clicked, form shows up. Technically I was thinking about using link function, binding a callback to element onClick event and add template content inside that callback using element.insertAfter method.
Problem is, I don't have access to template loaded by templateURL. And second problem is default behaviour of attribute directive - it automatically appends template as a child of the element. Is there any way how to disable it?