Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70818

Capacitor Angular Router-Outlet Activate Event Emitter Issue

$
0
0

I’m using Angular v12 and Capacitor v3 without Ionic. I’m trying to get the name of the active parent component. I’m using this code in the app.component.html:

<router-outlet (activate)="onActivate($event)"></router-outlet>

Then, in the app.component.ts I’m using the onActivate function like this:

onActivate(event: any) {
    alert(event.constructor.name);
}

In a web browser it alerts correctly with the active component name, but in an emulator or on my cell it alerts the letter e.

When I alerted event.constructor on my cell it shows the class name is ‘e’ and not the component name.

Is there a way of using Angular and Capacitor without Ionic to get the name of the active component?

Thanks for reading!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>