Dynamically load Web Components / HTML Imports?
问题 How would you go about dynamically loading a web component - in response to a url route change for example? I won't know the requested component ahead of time, so could you simply use JavaScript to write the HTML import and then add the code to the page, or are there implications with this? Perhaps Google Polymer helps? 回答1: Considering just Custom Elements, you can call document.registerElement whenever you want. So from that standpoint, you can dynamically load script using any well known