I need to include an <hr>
element between each instance of my transclude function, except for the last one.
The parent directive has a unique HTML template.
In this template, I utilize an Attribute directive to transclude the elements.
Example:
function transclusionDirective() {
return {
link: function (scope, element, attr, ctrl, transclude) {
transclude(function (clone, scope) {
element.append(clone);
});
}
};
}
This directive assists me in manually managing transclusion.
Now, my task is to determine how to selectively add the <hr>
element.
I assume that after the initial append, I can add something like element.append('<hr>');
.
How can I ascertain the number of elements the transclude needs to append ?
Is there a $last value or any indication to identify the end of the loop?
Thank you for your assistance!