Skip to content

How do you recommend passing in data to a custom element

Gabriel Forti edited this page Jul 31, 2018 · 4 revisions

The way of passing data to html tags is by attributes. With custom elements you can pass in data in two ways

  1. Attributes
  2. Custom function

Attributes

A nice feature of custom elements is being able to watch for mutations on attributes.

Lets say we have score card.

Clone this wiki locally