I am a little new to Angular with components, so pardon the newbie question.
Here is my scenario:
- I have a component (home) that asks the user for an address
- When the user enters the address I want to redirect them to a new component (map) where the address is displayed on a map using google maps.
- The data that needs to be passed to the map component is a Google maps generated json object
- I am navigating from the home component to the map component using the navigate method of $router, which I have injected into the home component via bindings.
My question is: how do I pass the data from the home component to the map component? I tried using ngLink, but the object is so large that it gets truncated in the url.
I know I can store the data globally and then retrieve it when I init the map component, but I was wondering if there is a better way of doing this with components?
Thank you