title: Refreshing page on a back button in angular/ionic
body: <p>I am trying to refresh the page on the back button to get the new data for article list. To be more specific I have an article list, and the article page, on both of them I have an option of liking an article. When a user likes an article on the article page, if it hits the back button the like icon on the article list page won't get refreshed with the new state. I have tried with making a function on clicking the back button, and then getting the data again, but the icon doesn't change. The data that I get on <code>console.log</code> is new data and I get the value for <code>like=1</code> which is correct if the user has liked the article, but the icon doesn't change.
  This is my code:</p>
  
  <p>I get the articles like this in my front page controller:</p>
  
  <pre><code>ArticleService.all().then(function(data){
      $scope.articles = data;
    })
  </code></pre>
  
  <p>In my article page html I have a back button link:</p>
  
  <pre><code>&lt;a ng-click="refresh()"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>And in my article list I check which value I have for like and then show the icon according to that:</p>
  
  <pre><code>&lt;a ng-if="article.like == 1" ng-click="like(article)" class="subdued"&gt;
                &lt;img class="social-images" src="icons/heart.svg"/&gt; Lik
              &lt;/a&gt;
              &lt;a ng-if="article.like == 0" ng-click="like(article)" class="subdued"&gt;
                &lt;img class="social-images" src="icons/heart-outline.svg"/&gt; Lik
              &lt;/a&gt;
  </code></pre>
  
  <p>This is my function in the article controller:</p>
  
  <pre><code>$scope.refresh = function (){
      return $state.go('main.front').then(function(state) {
        ArticleService.all().then(function(data){
          $scope.articles = data;
          console.log(data);
        })
      })
    };
  </code></pre>
  
  <p>But since that function is in the article controller it cannot refresh the data on the front page. How can I refresh the data in the front page controller from the page that has a different controller?</p>