-
Notifications
You must be signed in to change notification settings - Fork 2k
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
customElements.get() to extends custom elements #4556
Comments
Hmm, this is interesting! However, if you use this setup, it will work in all browsers: <link rel="import" href="../paper-tabs/paper-tabs.html">
<script>
customElements.whenDefined('paper-tabs').then(() => {
class MyTabs extends customElements.get('paper-tabs') {
static get is() { return 'my-tabs' }
}
customElements.define(MyTabs.is, MyTabs);
});
</script> Here is an example on Plunker: http://plnkr.co/edit/IeZk7sluWySWnqeWuOlt?p=preview |
Or maybe @bicknellr would know if this is a CustomElements polyfill issue. |
This seems like a HTML Imports polyfill thing: native imports are able to guarantee that scripts in the main document are run after scripts in @azakus, your workaround using |
|
@bmodeprogrammer can you confirm if your class that extends |
@azakus the definition of the object is in a imported file, and I have the tag on index. this is the index page.
UpdateI added this chromefirefoxEdgeIE 11I have all the latest version of each browser. And my windows is the windows 10 creators update. Updatehave this error 6x too on console. Chrome.
Edge Takes too long to load and has these errors:
IE 11 Takes too long to load and has no console error |
So what is the status of this issue? What is the proper way to extend custom elements (Paper, App) in Polymer 2.0? |
Thanks for the issue. It has been a great while since this issue was opened. Sadly, this issue misses a live reproduction with Polymer 2 for us to be able to debug and potentially fix. Polymer 2 fixes a large amount of issues, probably including this one as well. Please see CONTRIBUTING.md for guidelines on filing issues. You can start from this jsBin template as a starting point and link it in the issue template under "Live Demo". Feel free to file a new issue following these instructions if you can still reproduce this issue with Polymer 2. Thank you! For more documentation about extending custom elements, check out https://www.polymer-project.org/2.0/docs/devguide/custom-elements#extending-elements |
Description
I'm using customElements.get() to extends elements, and even if compile with poolymer cli with polymer build --js-compile or polymer serve only works all on chrome and opera except the paper-tabs extended, even in firefox does not work.
Example of component:
index.html importing the polyfills:
Edge -->




Firefox-->
IE -->
Chrome
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: