# Render template from component and get DOM element

**URL:** <https://discuss.emberjs.com/t/render-template-from-component-and-get-dom-element/9009>\
**Category:** Uncategorized\
**Created:** [October 26, 2015, 2:22pm UTC](https://discuss.emberjs.com/t/render-template-from-component-and-get-dom-element/9009 "2015-10-26T14:22:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IAmJulianAcosta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/iamjulianacosta/32/10028_2.png) [@IAmJulianAcosta](https://discuss.emberjs.com/u/IAmJulianAcosta)\
**Post date:** [October 26, 2015, 2:22pm UTC](https://discuss.emberjs.com/t/render-template-from-component-and-get-dom-element/9009/1 "2015-10-26T14:22:07Z")

</div>

Hi, I’m trying to do something like this:

```
//app/components/my-component.js
var template = Ember.getTemplate ('my-template');
template.setParameter ('name', 'Julian');
var dom = template.getDOM (); 

//app/templates/my-template.hbs
<h1>{{name}}</h1>

```

Is this posible?

---

<div class="post-metadata">

**Author:** ![gerrit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/gerrit/32/9140_2.png) [@gerrit](https://discuss.emberjs.com/u/gerrit)\
**Post date:** [October 27, 2015, 9:09am UTC](https://discuss.emberjs.com/t/render-template-from-component-and-get-dom-element/9009/2 "2015-10-27T09:09:19Z")

</div>

I think there is more context needed.

Within a component it is no problem.

You can do something like:

```
// app/components/my-component.js
MyComponent = Ember.Component.extend({
     name: 'Julian',
     becomeFocused: function() {
        var componentsDomElement = this.$();
        // doStuff
    }.on('didInsertElement')
});

//app/templates/components/my-component.hbs
<div class="some-class">
    name: {{name}} <--- should automaticly resovle to Julian
</div>

```
