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
import ChildElement from './my-element/components/child-element' | |
// registerElement exists on any DOM element which provides namespacing | |
document.body.registerElement('my-element', Blink); | |
class Blink extends HTMLElement { | |
constructor() { | |
this.addEventListener('click', this.win); | |
// This is namespaced inside of my-element because that is where it is registered. |
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
function Person(name) { | |
this.name = name; | |
this.greet = function() { | |
console.log('Hello ' + this.name); | |
} | |
this.setName = function(name) { | |
this.name = name; | |
} |