title: How to call http request on every page entering in AngularJS?
body: <p>how can I get a new http response every time if I come back to the Home-tab?</p>
  
  <p>I tried several things. I read about "$state.reload()", but I don't know where to use it. ng-click doesn't work in tabs.html.</p>
  
  <p>Controller:</p>
  
  <pre><code>.controller('HomeCtrl', function ($scope, $http) {
          'use strict';
  
  // how to call this every time on coming back to this tab?
          $http.get("api.php")
              .then(function successCallback(response) {
                  $scope.plan = response.data;
              }, function errorCallback(response) {
                  console.error("Failed HTTP get: " + response.status + " " + response.data);
              });
  // ...
  </code></pre>
  
  <p>tabs.html</p>
  
  <pre><code>&lt;ion-tabs&gt;
    &lt;ion-tab title="Home" href="#/tab/home"&gt;
      &lt;ion-nav-view name="tab-home"&gt;&lt;/ion-nav-view&gt;
    &lt;/ion-tab&gt;
  &lt;!-- ... --&gt;
  &lt;/ion-tabs&gt;
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;ion-nav-view&gt;&lt;/ion-nav-view&gt;
  </code></pre>
  
  <p>module:</p>
  
  <pre><code>.config(function ($stateProvider, $urlRouterProvider) {
      $stateProvider
  
          .state('tab', {
              url: '/tab',
              abstract: true,
              templateUrl: 'templates/tabs.html'
          })
  
          .state('tab.home', {
              url: '/home',
              views: {
                  'tab-home': {
                      templateUrl: 'templates/tab-home.html',
                      controller: 'HomeCtrl'
                  }
              }
          })
  </code></pre>
  
  <p>Thanks a lot!</p>