Last active
February 24, 2020 21:22
-
-
Save sbatson5/e617292921e08a4d3a95e9a8f9e80aab to your computer and use it in GitHub Desktop.
Step 2
This file contains 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 CandidateImage extends HTMLElement { | |
connectedCallback() { | |
console.log('Adding a candidate!'); | |
this.innerHTML = '<img src="https://cdn-candidates.com/bernie.jpg" />'; | |
} | |
} | |
/** | |
* Register our custom element | |
*/ | |
window.addEventListener('DOMContentLoaded', () => { | |
customElements.define('candidate-image', CandidateImage); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment