I’m very confused about the slide boxes now. I’ve had them working before, but I’m mostly migrated to Ionic 2 so coming back to implement slideboxes in an older v1 project is proving… challenging.
I’m trying a test with the html from the docs:
<ion-content scroll="false">
<ion-slides options="options" slider="data.slider">
<ion-slide-page>
<div class="box blue"><h1>BLUE</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box yellow"><h1>YELLOW</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box pink"><h1>PINK</h1></div>
</ion-slide-page>
</ion-slides>
</ion-content>
And added this to my controller.js:
angular.module('algorithms.controllers', [])
.controller('AlgCtrl', function($scope, $ionicModal, $ionicPopover, $ionicSlideBoxDelegate) {
As you can see - I’m using modals and popovers already.
Finally I’ve added this code to controller.js, after my modal and popover code:
$scope.$on("$ionicSlides.sliderInitialized", function(event, data){
// data.slider is the instance of Swiper
$scope.slider = data.slider;
});
$scope.$on("$ionicSlides.slideChangeStart", function(event, data){
console.log('Slide change is beginning');
});
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data){
// note: the indexes are 0-based
$scope.activeIndex = data.slider.activeIndex;
$scope.previousIndex = data.slider.previousIndex;
});
I know what it’s supposed to look like but I just get the three div boxes stacked on top of each other. I can scroll down and up, but there is no swipe.
What have I done wrong?