Re: [w3c/webcomponents] A new attribute similar to is="", but would allow multiple behaviors to be attached to a given element. (#662)

Perhaps like this:

```javascript
import CustomBehaviors from 'mylib';
CustomElements.define('my-element', {
 constructedCallback(elm) {
  if(elm.hasAttribute('has')) {
   CustomBehavior.init(elm); // puts 5 instances of CustomBehavior in WeakMap
  }
 }
});
```

The mechanism simply provides the necessary callbacks for you to experiment with the syntax:

 ```html
<div is="my-element" has="one two three four five"/>
```

– until it becomes popular enough to be included in the standard. I just think this works better than the other way around.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/662#issuecomment-328199688

Received on Friday, 8 September 2017 19:59:13 UTC