I have a component from where i need to pass data to another component on click of button so I have used [routerLink]
property in anchor like this
<a [routerLink]="['/employeedetail' , name, address,
detail3 , detail4, detail5, detail6 , detail7, detail8 ,
detail9, detail10></a>
defined corresponding route in app.route.ts
{
path: 'employeedetail/:name/:address/:detail3 /:detail4
/:detail5 /:detail6/:detail7 /:detail8 /:detail9 /:detail10 ',
component : employeedetailComponent
}
In perfect world it should work but it does not as it given an error saying
zone.js:355Unhandled Promise rejection: Unsupported number of argument for pure functions: 11 ; Zone: ; Task: Promise.then ; Value: Error: Unsupported number of argument for pure functions: 11(…) Error: Unsupported number of argument for pure functions: 11
I researched about this and found that angular2 router fails when there are 10 elements in inline template ,I tried out by removing last param in URL (detail10) and no error .
Question is how to pass these large number of params in url using [routerlink] or should I be using different approach for passing data from one component to another component ?