-
Notifications
You must be signed in to change notification settings - Fork 75
Working with Custom Elements and Events #123
Comments
This is unrelated to custom elements, as the lack of element modifiers will make it not work on native HTML elements as well. If you check the default project on Try, you will see that it has |
How do you bind a custom event then? I tried something like <os-modal onmodalclose={{action “whatever”}}>
Content
</os-modal> But the event didn’t fire |
It doesn't seem like you can |
<os-modal {{action 'onModalClose' on='modalclose'}}>
Some modal content
</os-modal> The newer versions of glimmer seem to no longer has this issue. Within Ember, it was fixed in 3.1.0 most likely because of emberjs/ember.js#15828 |
The latest version of the Glimmer VM uses capital letters rather than dasherized names as the signal that it's looking at a component. This should fix this issue, I think. |
I'm having a bit of trouble working with custom elements in an Ember app, and I think it comes from some assumptions that Glimmer makes about angle-bracket components.
If I have some custom element (say
os-modal
for example) that I want to bind a custom event listener do, I want to do something like this:However, I get an error from Glimmer:
The problem is that Glimmer has no way (that I know of) to tell the compiler that
os-modal
is not a Glimmer component, and to treat it like any other HTML element.Is there actually a way to tell Glimmer (or Ember) about non-Glimmer custom elements? If not, what would the steps be to work on that, and RFC for Glimmer? For Ember?
Original issue: ember-cli/ember-cli#6925
The text was updated successfully, but these errors were encountered: