From 0b527677bc881b69ca7b9e8a357963d0e9c67127 Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Sun, 29 Mar 2015 09:20:23 -0600 Subject: [PATCH] Update router.js --- mockup/router.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mockup/router.js b/mockup/router.js index df183742dd..d9e20f2469 100644 --- a/mockup/router.js +++ b/mockup/router.js @@ -21,7 +21,26 @@ @Route({ }) class App extends Ionic { - + constructor(nav: Navigation) { + nav.urls({ + url: '/contacts/:contact', + navigate: (url, params) => { + if(params.contactId) { + // Explicit routing + var contactList = new ContactList(); + rootNav.push(contactList, false // whether to animate); + var contactPage = new ContactPage(params.contactId); + rootNav.push(contactPage); + + // Now the user has a 2 history navigation: + // root -> contact list -> contact page + // + // But note, it was up to the developer to construct the appropriate history + } + } + }) + + } } @Route({