Transfert data from page to page

I don’t understand how it work to transfert data from one page to a other! It’s very simple , I want to get information from one page via a formulaire and I want to use this informations to make a new page ( google map ). When I make a “link-to” with my object as parameter, I can’t get it on my second page. I don’t want to store this data on the serveur side just transfert data from the first page to a other page. My solution at this time : stay on the same page and hide part of the page to simulate a new page. not very elegant! Sorry to ask for simple question but I don’t find the right information on tutorials.

If you want to keep some state around, the usual place to put it is a Service. You could do that.

But it may be even nicer for users if you can take the parameters from the form and put them into the URL. For example, if the form had latitude and longitude parameters, you could make the link like{{#link-to "show-map" latitude longitude}}, and declare the route like this.route('show-map', { path: '/map/:latitude/:longitude' }).

Thank you for your quick reply Service was the missing brick to make what I want!

1 Like