How do i navigate to router-outlet from .ts with additional data?

i am trying to navigate to

<ion-tab label="" icon="person" href="/tabs/(profile:profile)">
    <ion-router-outlet name="profile"></ion-router-outlet>

from my typescript code and add additional data like ionic3:

this.navCtrl.push(AboutPage, {
      data: color

i think i should use @angular/router , but as i understand router.navigateByUrl can’t add data (is this right??) and i somehow can’t get router.navigate(['/tabs/(profile:profile)', {data: data}]); to work, it says “Error: Cannot match any routes. URL Segment: ‘tabs’”

thank you for your help in advance


sorry for this thread, i realized this is not an ionic question, this is about Angular 6.

this.router.navigateByUrl('tabs/(profile:profile)'); works for me now (no leading “/” !!)

i still don’t know how to transfer data, but of course you can change the outlet and get it with

public outlet: string;
    constructor(private route: ActivatedRouter) {
        this.outlet = route.outlet;

for any1 who is interested in this, apparently it should work like this

0.1 Import (for beginners)

import { ActivatedRoute }       from '@angular/router'
import { Router } from '@angular/router';
    private route: ActivatedRoute,
public router: Router
  ) {
  1. Navigate
// Set our navigation extras object
    // that contains our global query params and fragment
    let navigationExtras: NavigationExtras = {
      queryParams: { 'session_id': sessionId },
      fragment: 'anchor'

    // Navigate to the login page with extras
    this.router.navigate(['/login'], navigationExtras);
  1. Url
  1. Recieve
ngOnInit() {
    // Capture the session ID if available
    this.sessionId = this.route
      .pipe(map(params => params.get('session_id') || 'None'));

    // Capture the fragment if available
    this.token = this.route
      .pipe(map(fragment => fragment || 'None'));

you also can pas Data, but i would recommend you to try to use only URL Data, it makes it really easy to release your ionic 4 app For Browser with links that you can copy and share