[Solved] Component Custom ID


#1

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?


#2

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

Thank you! it worked great! :smile: