Within the app routes:
{ path: 'calculator', component: CalculatorComponent, data: {physical: Physical}},
In the settings component:
if(this.selectedPhysical) {
this.router.navigate(['/calculator', this.selectedPhysical ]);
}
The result of the navigation attempt is incorrect:
http://localhost:3000/calculator;pK_Physical=4;fK_Measurement=2;dateString=5/22/2016;weight=270;height=70;hips=27;waist=51;neck=18.5
How can I properly pass the data to the route?
In the calculator component, I have the following code. How can I access the data passed in through the route?
ngOnInit() {
this.route
.data
.subscribe(v => this.selectedPhysical = <Physical>v);
console.log("phys = " + this.selectedPhysical);
}
If anyone knows how to achieve this, please share your knowledge.