Closed guilhermevini closed 8 years ago
Hello, You are right, it would be better to have the carousel id outside of the options. I will make the change this week-end.
For now you can try this:
Import the src file 'advanced-carousel.js' in your html instead of the .min.js and change:
bindToController with:
bindToController: {
itemDirective : '@',
carouselOptions: '=',
arrayProvider : '=',
onSelect : '&',
carouselId : '@?'
}
update the lines in activate() function with:
function activate() {
angular.extend(vm.options, vm.carouselOptions);
if (vm.carouselId) {
vm.options.carouselId = vm.carouselId
}
// ... rest of the function
Then you should be able to pass the carousel-id like you mentioned
<a-carousel carousel-id="show.ID" carousel-options="episodeDefaultOption" array-provider="show.Episodes" on-select="goEpisodeCarousel( item )"></a-carousel>
I haven't tested it so tell me if it works :)
After change
[INFO] Creating Carousel but DOM not ready yet...
Hi, I updated the carousel to version 1.1.1 Try it, it should work now inside a ng-repeat. Tell me if you have any problem with it.
I have a collection of shows. Each show have a collection of episodes.
I need to put a ID into each carrousel, but i can make a lot of option object. The perfect case for me:
<a-carousel carousel-ID="show.ID" carousel-options="episodeDefaultOption" array-provider="show.Episodes" on-select="goEpisodeCarousel( item )"></a-carousel>
I need this carousel-ID because, a-carousel.arrayupdated broadcast requide a carousel Id. its possible?