angular-vs-repeat
angular-vs-repeat copied to clipboard
Add support of ng-transclude
Fix ng-transclude in ng-repeat gives exception: Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found
That's really nice! Is this going to be merged soon? That's exactly what is needed for my project as well.
What's the example usage here?
@kamilkp Use case is very simple nested angular components. Would be nice to have it released.
ng-transclude
is also used synonymously as web component slots in AngularJS components. My combobox component would have benefited from this as it allows other devs to provide their own markup.
// consumer html
<idk-combobox>
<idk-combobox-item-slot>Custom</idk-combobox-item-slot>
</idk-combobox>
// component controller
angular.module('app', ['vs-repeat'])
.controller('appController', ['$scope', '$filter', function($scope, $fiter) {
// ...
}])
.component('idkCombobox', {
templateUrl: 'idkCombobox.html',
...
transclude: {
'customItemSlot': '?idkComboboxItemSlot'
},
...
});
// component template (idkCombobox.html)
<div class="combobox">
// <div vs-repeat> ...wishful thinking
<div class="combobox-item" ng-transclude="customItemSlot">
If customItemSlot exists, I get replaced with its content, otherwise I appear here by default.
</div>
// </div>
</div>