I am attempting to modify and return the content inside a custom directive (I have found some resources on SO but they only cover replacement). Here is an example:
HTML
<glossary categoryID="199">Hello and welcome to my site</glossary>
JS
.directive('glossary', [ function () {
return {
// I believe I need to access the current content here first before setting the template. Also, what about attributes on the custom directive?
template: "<strong>Welcome</strong>",
transclude: true,
link: function (scope, element, attrs, ctrl, transclude) {
transclude(function (clone) {
element.replace(clone);
});
}
};
}]);