Sending data to a new route [V2]

I am having some issues sending data from one page to another page. In v1 i could send query data in the router.load method and i could then access that data in the new view. The issue i am having with v2 is that i have to send all that data as URL parameters. This can cause me problems when sending LOTS of data between pages as the URL parameters are maxes at 2083 characters. I am sending url links and other data so i max out this limit pretty quickly.

Is there no other way to send an existing object to the next page? This seems like a basic thing to have in the router and would GREATLY benefit people that need to send large objects back and forth between page views. Can we port over that option from v1 to v2?

It is not a good practise to send a large amount of data between pages. If you use Template7 page or Component page then you can pass context when navigating to the page:

router.navigate('somepage', { context: { foo: 'bar' } })

Otherwise, it is better to pass something like ID or similar and get the required data on page load from global storage based on this ID

So far i cannot get this to work, im never redirected to the new page. I am calling the navigate method in an onclick event but never redirected.

myApp.router.navigate(
	'../pages/name/create_name.html',
	{
		context: {
			name: 'Matt',
			desc: 'testing desc'
		}
	}
);

Is this supposed to work without any type of route setup for the page? I am assuming this should just redirect to the ../pages/name/create_name.html without any type of routing from the route array?

No, routes must be set up

I must still be missing something. Here is my setup:

var myApp = new Framework7({
    routes: [
        {
            name: 'create-name',
            path: '/create-name/',
            url: '../pages/name/create_name.html'
        }
    ],
    ...other code
});

...Javascript Code here....

function createName() {
    var li = document.createElement('li');
    li.onclick = function() {

        myApp.router.navigate(
        	'../pages/name/create_name.html',
        	{
        		context: {
        			name: 'Matt',
        			desc: 'testing desc'
        		}
        	}
        );
    }
}

According to your routes it must be myApp.views.main.router.navigate(‘/create-name/‘, …)

“router” must be used on views, not on the app

OK that worked! Thank you! The only change i had to make to my route was to call componentUrl: './my-page.html' instead of url: './my-page.html'