test(back-button): add a page with a menu and back button

This commit is contained in:
Brandy Carney
2018-04-04 15:38:18 -04:00
parent a436fdf201
commit c15772651a

View File

@ -86,11 +86,40 @@
<ion-content padding>
<h1>Page Three</h1>
<p>Custom back button</p>
<ion-button class="next">Go to Page Four</ion-button>
</ion-content>
`;
// okay cool, we're in the DOM now
await nav.push(thirdPage);
const nextButton = thirdPage.querySelector('ion-button .next');
nextButton.addEventListener('click', async () => {
await goToPageFour(nav);
});
}
async function goToPageFour(nav) {
const fourthPage = document.createElement('div');
fourthPage.classList.add('fourth-page');
fourthPage.innerHTML = `
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-menu-button auto-hide="false"></ion-menu-button>
<ion-back-button color="danger"></ion-back-button>
</ion-buttons>
<ion-title>Page Four</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<h1>Page Four</h1>
<p>Back button and menu button</p>
</ion-content>
`;
// okay cool, we're in the DOM now
await nav.push(fourthPage);
}
</script>
</html>