Hi, last week i update my app to beta 14. I made some changes to my application to work. Everythinks gos fine, but in console i have this error:
TypeError: Cannot call method ‘forEach’ of undefined
at Object.caller (file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:102:27)
at Scope.$digest (file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:22012:40)
at Scope.$apply (file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:22282:24)
at file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:22572:22
at completeOutstandingRequest (file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:12714:10)
at file:///android_asset/www/js/libs/ionic/js/ionic.bundle.js:13094:7
This error ocurrs randomly, on the digest cycle. Particularly, in ionic.bundle.js at line 102, the variable “this._instances” is “undefined”.
Complete line:
this._instances.forEach(function(instance) { …}
UPDATE: Seems that the error occurs after watch.get(current) when “watch” is primitive “caller”. This is on line 22048 on ionic.bundle.js. This digest cycle is released after a $http request
SOLVED: The problem occurred on a $watch sintax defined in a controller on the side menu. This $watch was made over “getOpenRatio ()” property of $ionicSideMenuDelegate. The error deseapiers when was defined in this way:
$scope.$watch(function(){
return $ionicSideMenuDelegate.getOpenRatio();
}, function(newValue, oldValue) {
if (newValue == 0){
…
} else{
…
}
});
by.