One Page with two states

Hey, I’d like to make a page for adding and editing new contacts.

So i thought i could use the router.push() method for this. The Questions now how is the correct approach for this?

This is part of the JS from my ListPage:

function pushToDetailsPage(arg) {
	var lead = arg.data;
	router.push("contactDetailsPage", false, lead);
}

function pushToNewContactPage(){
	router.push("contactDetailsPage", true);
}

I defined the params in my DetailPage.js like this:

var params = this.Parameter;

But i don’t really get how to get these two params out of my params.
Or is there a better way to solve my problem?

Hi!
You can check out these parts of the documentation to see how parameter passing works for in-app navigation: