Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Fix for getElementByTagName invoked on Text node. #4650

Closed
wants to merge 1 commit into from

Conversation

fmoggia
Copy link

@fmoggia fmoggia commented Oct 25, 2013

This is a fixed for the problem with the find method when it tries to invoke getElementsByTagName on a TextNode causing the following error:
TypeError: Object # has no method 'getElementsByTagName'

Bug report:
#4120

@mary-poppins
Copy link

Thanks for the PR!

  • Contributor signed CLA now or in the past
    • If you just signed, leave a comment here with your real name
  • PR's commit messages follow the commit message format

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

find check if the element is a text node.
If element is a text node return an empty array.
Otherwise invoke getElementsByTagName on the element and return the result

Closes angular#4120
@ghost ghost assigned tbosch Dec 2, 2013
@tbosch
Copy link
Contributor

tbosch commented Dec 3, 2013

Thanks for the PR.
However, we didn't merge it into master as there was another PR that was a bit nicer (feature testing instead of nodeType testing and with a unit test): #4651

Closing this as a duplicate.

@tbosch tbosch closed this Dec 3, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants