Giter VIP home page Giter VIP logo

custom-elements's Introduction

Hey, I'm Shawn ๐Ÿ‘‹

I'm a web nerd building digital services for the City of San Francisco, father of two wild and wonderful boys, avid bicyclist, and lover of strange sounds.

custom-elements's People

Contributors

eugef avatar jamesfinley avatar mislav avatar shawnbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

custom-elements's Issues

how to call methods and such from a page on a component. help.

When I make a component, how do I call methods on it? Last 2 lines don't work. Help?

<body>
<chart-el></chart-el>
<script>
class ChartElextends HTMLElement {
  constructor() {
    super();
   return this
  }
  someOtherMethod() { /* ... */ }
  get someValue() { /* ... */ }
  set someValue(value) { /* ... */ }
}
customElements.define('chart-el', ChartEl)
let el = customElements.get('chart-el')
el.someValue
el.someOtherMethod()

Sunset the v0 spec

I think it's time. Might be good to preserve the original with a v0 branch (and remove the v1 references?) too.

V1 as an Object (without class)

You wrote about v1:

As with the v0 API, the ElementClass can be [...] an object with a prototype that extends the base class's.

Do you know how to define shuch a custom element (without the class notation) ?

I've tried but Chrome raise an error and wants a functionas the second parameter. Exemple:

customElements.define( "object-v1", { prototype: Object.create( HTMLElement.prototype ) } )

better polyfills with built-in support

Unfortunately the custom element polyfill provided by @webcomponents does not support extended built-in custom elements, has this known limitations and is slow.

The most bullet proof and battle tested polyfills I found are from @WebReflection. Please consider to at least mention them, if not just replacing by those:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.