Ion-slide-box enableSlide not working


#1

I’m new to Ionic, but I’m unable to get enableSlide to work. The problem occurs in Chrome and in the iOS emulator. I’ve also tried using Ionic beta.3 and beta.4. In troubleshooting, I tried logging $ionicSlideBoxDelegate.enableSlide() from the controller, and the return value is undefined. I also tried adding $ionicSlideBoxDelegate.enableSlide(false) to the slide-box example on CodePen, in the controller, and it has no effect.

It’s likely that I’m not using it correctly, as I just started using Ionic, but I can’t find my way past this problem. If anyone could help that would be great. Thanks. BTW, Ionic is awesome.


#2
$scope.getEnableSlide = function() {
  alert($ionicSlideBoxDelegate.enableSlide());
};

then call like

<button class="button button-positive button-clear no-animation" ng-click="getEnableSlide()">
    Click
</button>

#3

Thanks so much for your help! After seeing your example, I wrapped enableSlide in a scope function and call it using ng-init to disable the slider.