[Solved] Component Custom ID

Hi, I want to know if is possible to change the generated ID for a component?

<div id="ember377" class="ember-view">

</div>

I want to change “ember377” for whatever I need.

Is this possible?

Yes.

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):

{{my-component elementId=“a-really-cool-id”}}

For more: http://emberjs.com/api/classes/Ember.Component.html#property_elementId

3 Likes

Thank you! it worked great! :smile: