# Pass a template into a component

**URL:** https://forums.bitovi.com/t/pass-a-template-into-a-component/1063
**Category:** CanJS
**Created:** [March 28, 2019, 8:55pm UTC](https://forums.bitovi.com/t/pass-a-template-into-a-component/1063 "2019-03-28T20:55:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)
#### Post date: [March 28, 2019, 8:55pm UTC](https://forums.bitovi.com/t/pass-a-template-into-a-component/1063/1 "2019-03-28T20:55:25Z")

</div>

Hi,  
Is it possible to pass a stache template into a component as an attribute?

I’m thinking of a modal dialog component, where the actual form displayed within the component is passed in as an attribute of the component and then rendered as a stache template within the component.  
Cheers  
Rob

---

<div class="post-metadata">

### Author: ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)
#### Post date: [March 28, 2019, 10:35pm UTC](https://forums.bitovi.com/t/pass-a-template-into-a-component/1063/2 "2019-03-28T22:35:18Z")

</div>

Yes. I think can-stache’s docs have several examples of this. Ping me tomorrow if you don’t find them. You can pass slots, in-line partials, or view functions.

---

<div class="post-metadata">

### Author: ![robfoweraker](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/robfoweraker/32/284_2.png) [@robfoweraker](https://forums.bitovi.com/u/robfoweraker)
#### Post date: [March 29, 2019, 7:27am UTC](https://forums.bitovi.com/t/pass-a-template-into-a-component/1063/3 "2019-03-29T07:27:12Z")

</div>

Hi Justin,  
Got it! That works great.  
Thanks  
Rob
