defer execution of the html import till it is ready then execute in order.
If you are willing to load (and evaluate) geo-location-polyfill.js
synchronously in your script tag, it will block the execution of future script tags and make your example work.
It's probably better to gate your document script on some kind of ready
event however, and let things proceed asynchronously.
Some information about dynamic imports:
You can use imports dynamically by creating a <link>
tag imperatively and appending it to <head>
.
The import will be parsed as soon as it's loaded. The link tag will fire a load
event if you want to capture load complete.
Alternatively, you can use Polymer.import
method:
Polymer.import(arrayOfUrls, completionCallback);
Example:
Polymer.import(['a.html', 'b.html'], function() {
// a and b have loaded now
});