Tutorial on passing data between pages both forwards and backwards


#1

Hi All,

I’ve done a quick tutorial video on message passing between pages parent to child AND child to parent.

Enjoy,

Thank you


#2

I dislike the way the SessionProvider's set() method is written. As I see it, there’s a good reason that you can’t inject a NavController in a service provider: navigation is outside of their domain. I would move the nav.pop() call to the component and get rid of the parameter to set(). Also, if this is a project you’re suggesting be emulated by others, please eliminate use of any and meaningless property names like “data” and “item”.


#3

Thanks for watching.

I disagree that you cannot pass the navctrl as this SessionProvider is dedicated to this task. its entirely optional if you do or not and I do say that in the vid.

As for the other stuff, I have no problem with the word ‘item’ or ‘data’; and using ‘any’ I freely admit is somewhat abused as many folk don’t get it’s purpose in life. For this situation however it is fine as you genuinely won’t know what type of data will end up in it.