How can I return to the previous page with Ionic directives?

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) {;
}, 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>

Any ideas?

Please close this post. I solved my issue using < ion-nav-back-button> and delegate.

  <ion-nav-bar class="bar-positive">
  <ion-nav-back-button class="button-icon ion-arrow-left-c">


function goBack() {

This solution is not working anymore (or at least on my experience), try this code instead :

$scope.goBack = function() {
        console.log('Going back');