Hi guys im having a problem that i cant figure out, i just will copy the relevants parts of code.
Problem:
When i go to the #1 slide the previous event does actually work but the console.log
are launched twice times, this happens sometimes and sometimes only on the first time you run the app. Can anyone give me a clue of whats going on ?
CODE
$scope.slideValidate = function($index){
console.log('slideHasChanged $index=' + $index);
if($index === 0){
// first box
}
if($index === 1){
//second box
$ionicSlideBoxDelegate.previous();
}
if($index === 2){
// third box
}
};
**
UPDATED: HTML CODE
**
<ion-slide-box delegate-handle= "slidebox-form" show-pager="false" on-slide-changed="slideValidate($index)">
<ion-slide>
<div class="list">
<div class="item item-divider text-center">
Company Info
</div>
<label class="item item-input item-select">
<div class="input-label">
Company
</div>
<select ng-model="data.company" ng-options="company as company.name for company in companies track by company.id"></select>
</label>
</div>
</ion-slide>
<ion-slide>
<div class="list">
<div class="item item-divider text-center">
Company Info
</div>
<label class="item item-input item-select">
<div class="input-label">
Company
</div>
<select ng-model="data.company" ng-options="company as company.name for company in companies track by company.id"></select>
</label>
</div>
</ion-slide>
</ion-slide-box>