[ionic 4] master detail routing in tabs


#1

Hello,

these two ways works fine :

In template :

[href]="‘tabs/(contracts:contract/’+ contract.id + ‘)’"

In component :

this.router.navigateByUrl(`tabs/(contracts:contract/${contract.id})`);

But this one, doesn’t :

In component :

this.router.navigate( [ ‘tabs/(contracts:contract)’, {contract: contract} ]);

Why?

Thanks.


#2

Syntax Error?
this.router.navigate( [ ‘tabs/(contracts:contract)’, {contracts: contract} ]);


#3

Nope.

I would pass only one contract.


#4

Tab routing cannot use .navigate, only .navigatebyurl works

edit: I am not sure why that is, I believe it has to do with when using .navigate its changes (tabs:tabs) to %tabs:tabs%


#5

Hi all.

I’m facing the same problem. Template href works, and navigateByUrl also works. But when I try to navigate imperatively with router.navigate it fails. The way the router builds the Url is different. I’m indicating the outlet but it’s appended instead of replaced.
Someone found a solution to navigate with the router.navigate method?