<my-custom-element itemscope>
<button be-voke='
Invoke someViewModel:someMethod.
'>Click me</button>
<span itemprop=greeting>Hello</span>
</my-custom-element>What this does:
- Because this enhancement is adorning the button element, assumes we would want to act on the click event. This can be overridden (see below).
- Searches first for the closest element with an itemscope attribute. If not found, does a getRootNode().host. If that comes up empty, throws.
- If name of element has a dash in the name, does an await whenDefined
- Calls the method. Passes in the click event, and also the scope object, if applicable.