Are you including the script with a script tag, or are you actually loading
it in async?

If it's just a script tag then we recommend you place the script tag inside
an html import, and link to that import at the top of your element
definition
http://stackoverflow.com/questions/22135095/polymer-element-with-javascript-dependencies

If you're loading in a library asynchronously then you could leverage
core-shared-lib
https://github.com/Polymer/core-shared-lib

With core-shared-lib, elements get notified when the dependency has loaded
so they can kickoff and do their thing. We use it in the google-apis element
https://github.com/PolymerLabs/google-apis

Which we then use in pretty much all of the elements in GoogleWebComponents
https://github.com/GoogleWebComponents


On Sat, May 17, 2014 at 9:51 AM, Karan Goel <[email protected]> wrote:

> So say my element includes a script and the client uses my element
> multiple times on a single page. Is there a way to detect if the script is
> already on the page and thus not include the script.
>
> Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/b9da98d7-b4ec-405b-9d4b-5c5f24481a56%40googlegroups.com<https://groups.google.com/d/msgid/polymer-dev/b9da98d7-b4ec-405b-9d4b-5c5f24481a56%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAJj5OwBkAt63K-aWn2aQ8FTucSaNCXYBNmCZeQnXpWNWu-O-Rg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to