instanceMethodCaller throwing errors when this._instances is undefined
I have just updated to beta 14 and I am getting a new error where there wasn't in beta 13.
The error I'm getting is "TypeError: Cannot read property 'forEach' of undefined" in line 95 of ionic.js. Apparently the instanceMethodCaller is not checking if there are instances to loop prior to use the forEach function.
Hey @MundakaZgz, what are you looping over that is undefined, or what ionic component/service is causing this? Would you be able to post a codepen to demonstrate the issue?
Greetings, @MundakaZgz!
My sensors indicate that more information is required so that I may assist you.
- Can you provide a detailed description of this issue?
- How would a robot go about replicating this issue?
- What platform does this happen on? (iOS, Android, all, etc.)
- What platform versions does this happen on? (Android 4.2, iOS 7, all, etc.)
- Is this an issue with the Ionic Framework, or Ionic CLI?
Additionally, providing a codepen which replicates the issue is extremely helpful.
If you wish to get help using the framework itself, the recommended place is the forum.
Thank you for allowing me to assist you.
Just ran into the same issue after updating to beta 14. In case anyone else stumbles upon this, the issue came down to a delegate not getting bound to this properly.
Old:
$scope.$watch($ionicSideMenuDelegate.isOpen, function (isOpen) {
// do something
});
New:
var isSideMenuOpen = $ionicSideMenuDelegate.isOpen.bind($ionicSideMenuDelegate);
$scope.$watch(isSideMenuOpen, function(isOpen) {
// do something
});
I've just hit the same issue migrating to rc5. The solution above worked for me, thanks for posting it.