Check ember-ref-bucket first!
ember-ref-modifier
likely will be deprecated after ember-ref-bucket
major release
An implementation of the {{ref}}
element modifier.
Heavily inspired by ember-on-modifier and @ember/render-modifiers
.
ember install ember-ref-modifier
- Ember.js v3.13 or above
- ember-cli v2.13 or above
class Component {
@action callback(node) {
this.node = node;
}
}
import Component from '@ember/component';
export default class BritneySpearsComponent extends Component {
button!: DOMNode
}
This is essentially equivalent to:
didInsertElement() {
super.didInsertElement();
this.set('button', this.element.querySelector('button'));
}
It will also re-register property, if any of the passed parameters change.