Imagine creating a custom directive like the example below:
myModule.directive('myDirective', function () {
return {
template: "<p>hello</p>",
link: function (scope, element, attributes) {
element.text('<p>something else</p>')
}
};
});
This setup may seem redundant since the link function overrides the template entirely. However, my question is whether there's a way to combine both to create something useful. Is it necessary to eliminate the template altogether once a link function is in place?