-3
onClickMe(id)
{
  let decimal = this.date.getMonth()+1;
  this.router.navigate(['/RestaurantView/'+this.nembPerson+'/'+this.timereservation+'/'+this.date.getDate()+'/'+decimal+'/'+this.date.getFullYear()+'/'+id]) ;
} 

this is my router Navigate , i want to hide my params from url , what we should do , thanks for help

}

zgue
  • 3,793
  • 9
  • 34
  • 39

1 Answers1

0

I am also new to angular 4, but remember reading about routerlink array. I guess you could use something like

['/RestaurantView', this.nembPerson, this.timereservation, this.date, this.id ]

try adding skipLocationChange

this.router.navigate(['/initialRoute'], { queryParams: {}, skipLocationChange: true });

if you dont want the URL changes to be shown to the user. But you still get the queryParams on your newly routed component.

Else, try to implement a shared service to pass the data between components may be using a behaviour subject/subject

Hope this helps!!