Angular 1.5 allows multi transclude .
It is noteworthy that it would be useful to translate the dynamic number of elements into a directive and declare the names and locations of these transitions later (for example, in a link / compilation).
To clarify again, I want me to be able to do something like:
<multi-slot-transclude-example>
<transclude1>TEST1</div>
<transclude2>TEST2</div>
<transclude3>TEST3</div>
<transclude4>TEST4</div>
.... dynamic number of items ...
</multi-slot-transclude-example>
angular.module("multiSlotTranscludeExample", [])
.directive("directiveName", function(){
return {
restrict: 'E',
transclude: {
't1': '?transclude1',
't2': '?transclude2',
},
template: '<div ng-repeat="n in transcludedElementList">'
+ '<div ng-transclude="t{{n}"></div>'
+ '</div>'
};
})
Please note that in the declaration of the directive, which implements multi-transcussion, I must have prior knowledge of the number of elements that will be transmitted during the declaration.
Is there a way to do something similar in any link (or using a workaround) that retains the same functionality as the current sentence suggestions?