elementIdString
public
The HTML id
of the view's element in the DOM. You can provide this value yourself but it must be unique (just as in HTML):
1 | {{my-component elementId="a-really-cool-id"}} |
If not manually set a default value will be provided by the framework.
Once rendered an element's elementId
is considered immutable and you should never change it. If you need to compute a dynamic value for the elementId
, you should do this when the component or element is being instantiated:
1 2 3 4 5 6 | export default Ember.Component.extend({ setElementId: Ember.on( 'init' , function () { let index = this .get( 'index' ); this .set( 'elementId' , 'component-id' + index); }) }); |
Please login to continue.