title: How to implement history.back() in angular.js
body: <p>I have directive which is site header with back button and I want on click to go back to the previous page. How do I do it in the angular way?</p>
  
  <p>I have tried:</p>
  
  <pre><code>&lt;header class="title"&gt;
  &lt;a class="back" ng-class="icons"&gt;&lt;img src="../media/icons/right_circular.png" ng-click="history.back()" /&gt;&lt;/a&gt;
  &lt;h1&gt;{{title}}&lt;/h1&gt;
  &lt;a href="/home" class="home" ng-class="icons"&gt;&lt;img src="../media/icons/53-house.png" /&gt;&lt;/a&gt;   
  &lt;/header&gt;
  </code></pre>
  
  <p>and this is the directive js:</p>
  
  <pre><code>myApp.directive('siteHeader', function () {
      return {
          restrict: 'E',
          templateUrl: 'partials/siteHeader.html',
          scope: {
              title: '@title',
              icons: '@icons'
          }
      };
  });
  </code></pre>
  
  <p>but nothing happens. I looked in the angular.js API about <a href="http://docs.angularjs.org/api/ng.$location" rel="noreferrer">$location</a> but didn't find anything about back button or <code>history.back()</code>.</p>