Uncaught TypeError: Cannot read property 'nodeName' of undefined angular.js:5356 #1058

Closed
coli opened this Issue Jun 15, 2012 · 1 comment

Projects

None yet

2 participants

@coli
coli commented Jun 15, 2012

This bug is triggered when say a ng-click removes the node from the dom and you use $location service

Click on the button at http://jsfiddle.net/ADukg/258/

Uncaught TypeError: Cannot read property 'nodeName' of undefined angular.js:5356
(anonymous function) angular.js:5356
f.event.dispatch jquery.min.js:3
f.event.add.h.handle.i

This was working fine in say rc12 http://jsfiddle.net/ADukg/259/

@ghost
ghost commented Jun 15, 2012

I am having a similar issue with 1.0.

http://jsfiddle.net/icub3d/daSJ5/4/

It looks like it's searching for an element to grab the href. Not sure why it needs to do that, especially when the ng-click is calling a function that uses $location.

@vojtajina vojtajina was assigned Jun 16, 2012
@vojtajina vojtajina added a commit that closed this issue Jun 21, 2012
@vojtajina vojtajina fix($location): url rewriting if element was removed
When user clicks a link, $location needs to intercept this event.  The <a> doesn't have to be target element of the DOM event, so it needs to traverse the DOM, to find first <a> parent.

If the target element was removed from DOM, during the same event, it would throw an exception. This fixes the issue.

Closes #1058
3da4194
@vojtajina vojtajina closed this in 3da4194 Jun 21, 2012
@vojtajina vojtajina was unassigned by google-admin Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment