title: AngularJS (Ionic Framework) - changing State within controller doesn't seem to be working
body: <p>What I am trying to do is within the Search controller, once I get the search results back from the server ($http) change view to a different view - the search results view. I am not sure if the approach I am going about it is right, but either-way it doesn't seem to be working. I will need to pass the response as well, so the new view can display the results/response.</p>
  
  <p>My app.js:</p>
  
  <pre><code>.....state('tab.search', {
    url: '/search',
    views: {
        'tab-search': {
            templateUrl: 'templates/tab-search.html',
            controller: 'SearchCtrl as search'
        }
    }
  })
  .state('tab.search-results', {
    url: '/results',
    views: {
        'tab-search-results': {
            templateUrl: 'templates/tab-search-results.html',
            controller: 'SearchResultsCtrl as searchResults'
        }
    }
  })
  </code></pre>
  
  <p>Then my search controller has:</p>
  
  <pre><code>.controller('SearchCtrl', function($scope, $state, $location, $ionicPopup, service) {
  ....
   $scope.doSearch = function(state) {
      .....
      var result  = service.doSearch(dataObj);
      result.then(function(response) {
          console.log("I'm here");
          $state.go('tab.search-results');
          ......
  </code></pre>
  
  <p>My search results view (tab-search-results.html) has the following basic code at the moment:</p>
  
  <pre><code>&lt;ion-view view-title="Search Results"&gt;
      &lt;ion-content padding="true"&gt;
          hello world
       &lt;/ion-content&gt;
  &lt;/ion-view&gt;
  </code></pre>
  
  <p>This basic structure is how all my other pages/views are setup too.</p>
  
  <p>What happens when I perform the search is that the console message gets outputted, and then the URL changes to /results as per the <strong>tab.search-results</strong> state, but the template/view doesn't change/show.</p>
  
  <p>Interestingly if I change $state.go('tab.search-results'); to point to another app state/view that I know works, it works perfectly - but for whatever reason this state/view isn't working.</p>
  
  <p>Also, if there is a better way of achieving this same thing, then please let me know.  I will be needing to eventually pass the "response" from SearchCtrl to SearchResultsCtrl - or rather access it on the search results page in one form or another.</p>
  
  <p>Many thanks.</p>