-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(browser_adapter.ts): baseElement.getAttribute #3214
Conversation
@@ -287,7 +287,7 @@ function getBaseElementHref(): string { | |||
return null; | |||
} | |||
} | |||
return baseElement.attr('href'); | |||
return baseElement.getAttribute('href'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, could you add a unit test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tests but ran into a problem with baseElement cache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a resetBaseElement
method to the DomAdapter
(and all implementations). You can narrow it down to only the JS/Dart adapter via if (DOM.supportsDOMEvents()) {...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did something wrong here when adding resetBaseElement
and getBaseHref
to the other adapters
var $head = DOM.defaultDoc().head; | ||
DOM.appendChild($head, $base); | ||
|
||
var subject = DOM.getBaseHref(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fails due to baseElement being cache
from the prevous test
a9cb434
to
b44620a
Compare
I'm having trouble correctly testing this in Dart. Can anyone help? |
@gdi2290 sure– what's the problem? |
f32a1ad
to
e4379ec
Compare
@btford with Dart I'm trying not run these tests for Dart (since it's only in js atm). Using |
I think that's what he meant, but I'm not sure. :/ |
Moving this to alpha-35. |
currently throwing an error ```error Error during instantiation of LocationStrategy! (RouterLink -> Router -> Location -> LocationStrategy). ORIGINAL ERROR: TypeError: baseElement.attr is not a function ```
@btford can you take over this PR? you can either close and recreate it or push to my repo |
Yes, I'll get this in today. |
Fixed and pushed to presubmit. 👍 |
thanks! 👍 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
currently throwing an error
closes #3441