I have a normal button with an icon and i want to give to it the feature of a ‘back button’, i.e. I want that when I click on it, the website returns to the previus page. I tried to inject native navigator backHistory() in an Angular function but it doesn’t work.
I tried the code:
document.addEventListener(“backbutton”, function (e) {
navigator.app.backHistory();
}, false);
Below header and button:
<ion-header-bar class="bar-positive">
<button class="button icon ion-arrow-left-c"></button>
<h1 class="title">Detail</h1>
</ion-header-bar>
Any ideas?