Skip to content
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

HTMLImports.Loader maybe callback twice #418

Closed
niuhf0452 opened this issue Feb 8, 2014 · 1 comment
Closed

HTMLImports.Loader maybe callback twice #418

niuhf0452 opened this issue Feb 8, 2014 · 1 comment

Comments

@niuhf0452
Copy link

I apologize for my bad english first.
When I write x-page (an element to load html file into main document dynamically, like iframe),
I use this method:

 HTMLImports.importer.load(doc, myCallback);

Sometimes, myCallback will be called twice.
In HTMLImports/src/Loader.js, I found the call sequence:
addNodes -> require -> dedupe -> tail -> checkDone,
and
addNodes -> checkDone.
If all the 'nodes' to fetch are cached before, then oncomplete will be called twice. And it indeed called twice sometime.
It seems there's no matter with HTMLImports/src/Parser.js, but it really bother me.

@dfreedm
Copy link
Member

dfreedm commented Feb 12, 2014

Marking this WONTFIX.
We are removing this hacky loader api for the ability to watch for new <link rel="import"> elements inserted dynamically, the same as what you would do in a native browser implementation of HTML Imports.

This new ability will be enabled in the next release.

Mailing list thread with a similar question: https://groups.google.com/forum/#!msg/polymer-dev/pn1mhqLugVU/iQnfaH4W5_sJ

@dfreedm dfreedm closed this as completed Feb 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants