Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bahrus/be-voke

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

be-voke [TODO]

<my-custom-element itemscope>
    <button be-voke='
        Invoke someViewModel:someMethod.
    '>Click me</button>
    <span itemprop=greeting>Hello</span>
</my-custom-element>

What this does:

  1. Because this enhancement is adorning the button element, assumes we would want to act on the click event. This can be overridden (see below).
  2. Searches first for the closest element with an itemscope attribute. If not found, does a getRootNode().host. If that comes up empty, throws.
  3. If name of element has a dash in the name, does an await whenDefined
  4. Calls the method. Passes in the click event, and also the scope object, if applicable.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published