ember-component-attributes
This addon lets you easily bind HTML attributes to your ember components. It was inspired by the discussion in this rfc.
Installation
ember install ember-component-attributes
Usage
To bind an attribute foo
to the value of bar
, pass (html-attributes foo=bar)
as the last positional argument to your component:
This helper also works with class
and id
attributes if you prefer to keep all your attributes together.
Attribute bindings defined with the html-attributes
helper will always win over attribute bindings that are defined on the class.
Supported Versions of Ember
This addon is guaranteed to work with Ember 2.8 and up. It may work with older versions as well although the earliest working version is unknown.
Limitations
This addon is implemented with a naive Glimmer AST transform so you can't do fancy things like
If this feature is accepted into the Ember core then we will consider removing this limitation.