我的角度应用程序存在非关键问题。我在表单中有一个简单的搜索字段,当我按Enter键提交时,我在angular.js第12007行(AngularJS v1.4.0-rc.0)中得到一个例外:
TypeError: Cannot read property 'end' of undefined
at VM2885 angular-animate.js:2209
at forEach (angular.js:332)
at closeChildAnimations (VM2885 angular-animate.js:2202)
at queueAnimation (VM2885 angular-animate.js:2048)
at Object.$$AnimateQueueProvider.$get.push (VM2885 angular-animate.js:1943)
at Object.$AnimateProvider.$get.leave (angular.js:5017)
at cleanupLastView (angular-route.js:913)
at angular-route.js:942
at publicLinkFn (angular.js:7199)
at $get.boundTranscludeFn (angular.js:7345)
原因是angular-animate.js中的closeChildAnimations函数:
function closeChildAnimations(element) {
var node = element[0];
var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');
forEach(children, function(child) {
var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME));
var animationDetails = activeAnimationsLookup.get(child);
switch (state) {
case RUNNING_STATE:
//HACK: Added check here as it breaks on form submit on the search page otherwise
if(animationDetails.runner !== undefined)
animationDetails.runner.end();
/* falls through */
case PRE_DIGEST_STATE:
if (animationDetails) {
activeAnimationsLookup.remove(child);
}
break;
}
});
}
我已将if语句添加为临时hack。似乎activeAnimationsLookup中的一个元素没有跑步者成员。
这是应该向有角度的团队报告的事情,还是我在这里遗漏了什么?添加if语句有效,但我不喜欢编辑一个相对稳定的框架,例如angular。
答案 0 :(得分:0)
这是ng-animate中的一个错误,正如Phil提到的https://github.com/angular/angular.js/issues/11658所讨论的那样。
结束这个问题。