Last active
August 6, 2017 17:56
-
-
Save enjikaka/a690ee158e635dd34d4a0837de97076f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TemplateComponent extends HTMLElement { | |
| /*...*/ | |
| get path () { | |
| const query = `link[rel="import"][href*="${this._tagName}"]`; | |
| const target = document.head.querySelector(query); | |
| return target.href.split(document.location.host)[1]; | |
| } | |
| /*...*/ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment