@Smirnova wrote:
Hi there,
I need to implement two sliders into two different views. So I'm using two different controllers for that:
.controller('SettingsCtrl', function($scope, $state) {
//options for the slider
$scope.options = {
loop: true,
pagination: false,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
};$scope.data = { slides : [ { drink_family_name: 'beer', drink_family_img: 'img/ionic.png' }, { drink_family_name: 'wine', drink_family_img: 'img/ionic.png' }, { drink_family_name: 'spirit', drink_family_img: 'img/ionic.png' }, { drink_family_name: 'cocktail', drink_family_img: 'img/ionic.png' } ] };
})
.controller('MainCtrl', function($scope, $state, $ionicSlideBoxDelegate) {$ionicSlideBoxDelegate.update(); //options for the slider $scope.options = { loop: true, pagination: false, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev' }; $scope.data = { drinks : [ { family: 'beer', name: 'beer glass 200ml', img: 'img/ionic.png', contains: '0.6' }, { family: 'beer', name: 'beer glass 500ml', img: 'img/ionic.png', contains: '1.6', }, { family: 'wine', name: 'wine glass 100ml', img: 'img/ionic.png', contains: '1' }, { family: 'wine', name: 'wine bottle 750ml', img: 'img/ionic.png', contains: '8', } ] };
})
The result: first slider works fine, the second one shows the first slide for half a second and then - nothing.
What am I doing wrong here? )
Posts: 1
Participants: 1