# هل يمكنني استخدام routeAction في glimmer single-file components؟

**URL:** <https://meta.discourse.org/t/can-i-use-routeaction-in-glimmer-single-file-components/288936>\
**Category:** Development\
**Created:** [16 ديسمبر 2023، 10:03م UTC](https://meta.discourse.org/t/can-i-use-routeaction-in-glimmer-single-file-components/288936 "2023-12-16T22:03:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [17 ديسمبر 2023، 2:39م UTC](https://meta.discourse.org/t/can-i-use-routeaction-in-glimmer-single-file-components/288936/5 "2023-12-17T14:39:57Z")

</div>

من اختباري، ما يلي يعمل.

```js
import { get } from "@ember/object";
import { routeAction } from "discourse/helpers/route-action";

{{on "click" (routeAction "showLogin" (get this "router._router"))}}

```

يفترض أن لديك خدمة `router` معرفة في المكون.

لست متأكدًا مما إذا كان يعتبر ممارسة سيئة. لا يبدو فكرة جيدة، لكنها تعمل. 😄

---

_[View the full topic](https://meta.discourse.org/t/can-i-use-routeaction-in-glimmer-single-file-components/288936)._
