# What is the difference between raw.hbs handlerbar files and only .hbs handlerbar files?

**URL:** <https://meta.discourse.org/t/what-is-the-difference-between-raw-hbs-handlerbar-files-and-only-hbs-handlerbar-files/58565>\
**Category:** Development\
**Created:** [2017年三月7日 16:41 UTC](https://meta.discourse.org/t/what-is-the-difference-between-raw-hbs-handlerbar-files-and-only-hbs-handlerbar-files/58565 "2017-03-07T16:41:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![spirobel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spirobel/32/170908_2.png) [@spirobel](https://meta.discourse.org/u/spirobel)\
**Post date:** [2020年二月7日 12:30 UTC](https://meta.discourse.org/t/what-is-the-difference-between-raw-hbs-handlerbar-files-and-only-hbs-handlerbar-files/58565/4 "2020-02-07T12:30:16Z")

</div>

对于原始插槽（raw outlets），是否也有类似 `setupComponent(args, component)` 的方法？那计算属性呢？我想根据上下文中的数据做一些计算。我该如何实现？我甚至不确定我配套的 .js.es6 文件命名是否正确。我应该将其命名为 .raw.js.es6 吗？

> [@SetUpComponent not being called for topic list tags plugin outlet](https://meta.discourse.org/t/setupcomponent-not-being-called-for-topic-list-tags-plugin-outlet/58358/3):
>
> Thanks for your reply. I see there is another plugin outlet “topic-list-after-title”. I added the raw.hbs file in the “topic-list-after-title” folder. I added some test text in the raw.hbs file, and I was able to view the same in the discourse site. [But as mentioned here](https://meta.discourse.org/t/important-changes-to-plugin-outlets-for-ember-2-10/54136) , if we add corresponding js.es6 file and export default { setupComponent(args, component) { component.set('today', new Date()); } } the setUpComponent will be called before rending the hbs connector file. But in my…

好的，我找到解决方案了：重新打开 Topic 模型并在其中创建一个计算属性：

[https://github.com/paviliondev/discourse-events/blob/master/assets/javascripts/discourse/initializers/event-edits.js.es6#L74](https://github.com/paviliondev/discourse-events/blob/master/assets/javascripts/discourse/initializers/event-edits.js.es6#L74)

之后，它就可以在原始模板中使用了：

[https://github.com/paviliondev/discourse-events/blob/master/assets/javascripts/discourse/connectors/topic-list-after-title/topic-list-event-rsvp.raw.hbs#L5](https://github.com/paviliondev/discourse-events/blob/master/assets/javascripts/discourse/connectors/topic-list-after-title/topic-list-event-rsvp.raw.hbs#L5)

---

_[View the full topic](https://meta.discourse.org/t/what-is-the-difference-between-raw-hbs-handlerbar-files-and-only-hbs-handlerbar-files/58565)._
