# \[Aurelia 1\] Returning a value upon successful navigation to a route / Clarifications about router events

**URL:** <https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609>\
**Category:** Help Requests\
**Created:** [April 27, 2026, 3:29pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609 "2026-04-27T15:29:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [April 27, 2026, 3:29pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609/1 "2026-04-27T15:29:15Z")

</div>

Greetings.

We are using Aurelia 1.

We are building a page which acts as a carousel component whose pages are routes in a child router which fetch data from a backend.

To detect when a page has finished loading, we use router events as described in [the official documentation](https://aurelia-1.gitbook.io/v1-docs/getting-to-know-aurelia/routing/router-events).

**Is there any way use these events to pass a value back to the event listeners?**

For reference, the event parameter has a `result` property with an `output` value, but we cannot find a way to populate it. Any value returned by `canActivate` does not seem to reach this point.

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [April 28, 2026, 12:27pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609/2 "2026-04-28T12:27:11Z")

</div>

We have changed out approach and do not require this anymore.

I am leaving this open in case anyone else needs it.

Regards.

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [May 5, 2026, 1:34pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609/3 "2026-05-05T13:34:06Z")

</div>

Back to this since we are having problems.

We have noticed that if navigation to a route fails due to an error / rejection in `canActivate` (even when explicitly returning `false`) the event raised is still `RouterEvents.Success`, not `RouterEvents.Failed` or `RouterEvents.Canceled`. The callback receives as `event.result` the object `{"status":"completed","completed":true}` which contains no further information.

**Is there a built-in way to detect this kind of failure?**

I guess as a safer solution we can ignore router events and use our own events raised on `activate` / `bind`, though.

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [May 5, 2026, 1:50pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609/4 "2026-05-05T13:50:36Z")

</div>

More inconsistent behaviours.

By `await`ing `router.navigateToRoute` we get this result:

- successful `canActivate` (truthy return): `{"status":"completed","completed":true,"output":undefined}` regardless of the value actually returned by `canActivate`
- failed `canActivate` (falsey return): `{"status":"completed","completed":true,"output":<return value of canActivate>}` and a `Success` event is triggered with the result described in my previous post which is DIFFERENT from this one.

---

<div class="post-metadata">

**Author:** ![m-gallesio](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/m-gallesio/32/1288_2.png) [@m-gallesio](https://discourse.aurelia.io/u/m-gallesio)\
**Post date:** [May 5, 2026, 2:11pm UTC](https://discourse.aurelia.io/t/aurelia-1-returning-a-value-upon-successful-navigation-to-a-route-clarifications-about-router-events/6609/5 "2026-05-05T14:11:20Z")

</div>

After further investigations, the spurious successful navigation only happens if the FIRST navigation fails.  
Our child router starts off with a default, surely loaded loading page which probably interferes somehow.

This needs futher investigation on our end.
