Context types example
This code defines a class
MyApp which extends BaseComponent from the
The class has an
init$ object that sets initial values for four properties:
firstis set to the string 'FIRST'.
attris set to an empty string.
*secondis set to the string 'SECOND'.
myctx/thirdis set to the string 'THIRD'.
init$ object also defines an
onClick method that updates the value of
property to the current timestamp when the first
<div> element is clicked.
The class has a static
template property that defines an HTML template for the component
using the Symbiote template syntax. The template defines four
<div> elements, each of which
displays the value of one of the four properties defined in the
The class also uses the
bindAttributes() method to map an attribute named
attr property, which means that if the
attr-test attribute is set on an
instance of the component, the value of that attribute will be stored in the
Finally, the class registers itself as a custom element with the name
reg() method from the
BaseComponent class, which means that instances of the
component can be created and inserted into the DOM using the