I have been struggling to find a big in my code that is causing this error Receiving Type Error Cannot Read 'length' ionic.bundle.js
I have tracked it down to this piece of code - has anyone seen this before or know how to correct it? I expect its an issue with slidebox delegate however commenting this out does not make a difference and my template code is exactly the same as in other views that use a slidebox without issues?
$ionicModal.fromTemplateUrl('templates/exercise-modal.html', {
scope: $scope
}).then(function (addExerciseModal) {
$scope.addExerciseModal = addExerciseModal;
});
// Triggered in the exercise modal to close it
$scope.closeAddExerciseModal = function() {
$scope.addExerciseModal.hide();
};
// Open the exercise modal
$scope.OpenAddExerciseModal = function() {
$ionicSlideBoxDelegate.slide(0);
$scope.addExerciseModal.show();
};
So the $ionicSlideBoxDelegate resturns undefined β und the slide functions tries to figure out how many slides are there β and it is trying to call undefined.length
This is inside a modal that does not know the length of activeExercise.images upon loading the main page as I pass in that variable depending on the exercise loaded.
do you think that is what is happening? If so how can I assign it a value on page load to ensure its happy?