kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

Add support of ng-transclude #165

Open arthud opened 7 years ago

arthud commented 7 years ago

Fix ng-transclude in ng-repeat gives exception: Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found

arrigod commented 6 years ago

That's really nice! Is this going to be merged soon? That's exactly what is needed for my project as well.

kamilkp commented 6 years ago

What's the example usage here?

falsyvalues commented 5 years ago

@kamilkp Use case is very simple nested angular components. Would be nice to have it released.

kerryj89 commented 2 years ago

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>