ember-attribute-modifier

0.0.1 • Public • Published

ember-attribute-modifier

This attribute modifier is made for declarative attribute bindings for DOM nodes.

This addon is heavily "inspired" by ember-class-modifier.

Usage

When you want to conditionally apply a list of variable attributes onto an element, it's a pain (especially for data-test attributes).

  // component.js
  myAttributes = ['data-test-thing', 'data-test-other-thing']
  // also works like
  myAttributes = 'data-test-thing, data-test-other-thing'
  <button {{attribute this.myAttributes}}></button>

Conditionally remove attributes based on booleans

  // component.js
  isDisabled = false
  <div {{attribute data-test-disabled=this.isDisabled}}></div>

Compatibility

  • Ember.js v3.4 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

ember install ember-attribute-modifier

Usage

[Longer description of how to use the addon in apps.]

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i ember-attribute-modifier

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

7.02 kB

Total Files

8

Last publish

Collaborators

  • donaldwasserman