Angular animation runner undefined

I have a non-critical issue with my angular app. I have a simple search box on a form, and when I press Enter to submit, I get an exception on the angular.js 12007 (AngularJS v1.4.0-rc.0) line:

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)

      

The reason for this is the closeChildAnimations function in angular-animation.js:

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;
    }
  });
}

      

I added an if statement as a temporary hack. It seems like one of the elements in activeAnimationsLookup doesn't have a runner element.

Is this something that should be reported to the angular team, or am I missing something here? Adding an if statement works, but I'm not happy with editing a relatively stable framework like angular.

+3


source to share


1 answer


It was a bug in ng-animate that was fixed as discussed at https://github.com/angular/angular.js/issues/11658 as Phil mentioned.



Completion of this question.

0


source







All Articles