Javascript 接收类型错误无法读取';长度';ionic.bundle.js
我收到Javascript 接收类型错误无法读取';长度';ionic.bundle.js,javascript,ionic-framework,typeerror,Javascript,Ionic Framework,Typeerror,我收到uncaughttypeerror:在加载我的ionic应用程序的特定页面时无法读取未定义的错误的属性“length” 因为这个错误指向内核中的一个文件,所以我不知道如何调试它。我在整个控制器文件中执行了断点,无法将其锁定 在加载整个页面后出现错误 希望这幅画能画出1000字 编辑 我现在已经跟踪到这段代码的这个问题 $ionicModal.fromTemplateUrl('templates/exercise-modal.html', { scope: $scope }).then
uncaughttypeerror:在加载我的ionic应用程序的特定页面时无法读取未定义的错误的属性“length”
因为这个错误指向内核中的一个文件,所以我不知道如何调试它。我在整个控制器文件中执行了断点,无法将其锁定
在加载整个页面后出现错误
希望这幅画能画出1000字
编辑
我现在已经跟踪到这段代码的这个问题
$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();
};
然而,我在我的应用程序中的其他地方使用了它,它运行得很好。很明显,幻灯片在该行执行时未定义。回顾一下源代码——上面几行你应该看到一些东西,让你知道幻灯片
应该是什么(如果你还不知道的话)
然后看看幻灯片是如何创建/提供的,然后再回到您自己的代码中。当然,您不是。。但是这个代码是错误的。它可能会根据您传递的内容或您提供的配置等生成幻灯片
。这就是为什么我建议您反向操作。