Import events

Fired on <import-element>. They do not bubble.

Event When detail
load Every <custom-element> in the file has been defined { url: string }
error The file could not be fetched (non-2xx or network failure) { url: string, status: number }
<import-element from="/components/charts.html" onload="console.log('ready', event.detail.url)" onerror="showFallback(event.detail.status)"></import-element>

onload and onerror are native handler attributes, so they work on a plain page too.

See the live example on <import-element>.

Edit this page on GitHub · View as Markdown