Hi All,
I’m attempting to create a directive that transcludes an ion-slide-box, and another to wrap ion-slide. Like so:
<menu-carousel>
<menu-carousel-pane><div>This is some slide contents</div></menu-carousel-pane>
<menu-carousel-pane><div>This is some slide contents</div></menu-carousel-pane>
<menu-carousel-pane><div>This is some slide contents</div></menu-carousel-pane>
</menu-carousel>
HTML looks like this:
Menu Carousel:
<div>There are {{menu.slides.length}} slides!</div><ion-slide-box ng-transclude></ion-slide-box>
Menu Carousel Pane:
<ion-slide ng-transclude></ion-slide>
I’ve created a directive for menu-carousel, and also a directive for menu-carousel-pane. menu-carousel-pane requires menu-carousel to be there, and I supply a method in menu-carousel to add a new slide, which the panes then call to add themselves. Once a new slide is added, $ionicSlideBoxDelegate.update() gets called. The problem though, is I can’t seem to get addPane to be called.
Plunkr: http://plnkr.co/edit/AASx23nIwYHCMSVd2pds?p=preview
If I insert a div inside the ion-slide-box and move the ng-transclude to that, like this:
<div>There are {{menu.slides.length}} slides!</div><ion-slide-box><div ng-transclude></div></ion-slide-box>
Then addPane gets called, except I end up with one giant slide, which makes sense I guess. It makes me think I’m doing this right, though maybe it’s a false trail.
If I’m doing something dumb, I’d love to know! Any suggestions why this isn’t working?
Thanks for your help!