I have two ion slide boxes. One in state a
and other in state b.
Both of them have same controller.
In the controller, I have
$scope.billsDetails=function(deploymentId,startingDate,name){
$rootScope.enableSwipe = false;
$scope.$watch(function(){
return $rootScope.enableSwipe;
}, function() {
console.log("watching" + $rootScope.enableSwipe)
if(!$rootScope.enableSwipe){
console.log("swipe not working")
$ionicSlideBoxDelegate.enableSlide(false)
}
else if($rootScope.enableSwipe){
console.log("swipe working")
$rootScope.$broadcast('loading:hide')
$ionicSlideBoxDelegate.enableSlide(true)
}
}, true);
}
Now, I intended to do it for slides in state b
.
When I open the app, I am in state a
, state a
has ion slide box
as well and it works fine.
I go to state b
. It has swipe disabled initially and then in a couple of seconds it becomes enable. When I go back to state a
now, the slide box has its swipe disabled.
Why is that? I have checked and rechecked that when I am going back to state a
, enable swipe has been set to true already, How do I fix this?