title: code passes through $scope.options first instead of $http.get
body: <p>i have an ion-slide component with 3 slides. when running the app the first time, all three slides load. however, going to another controller and coming back to the controller where the ion-slide is (using $state.go), only displays one slide and has the following error:</p>
  
  <pre><code>TypeError: Cannot read property '0' of undefined
  </code></pre>
  
  <p>seeing this error, i traced it passes through this line first:</p>
  
  <pre><code>sharedProperties.setProperty($scope.cardNumbers[$scope.currentIdx]
  .CardNumber);
  </code></pre>
  
  <p>instead of this code fetching the card number:</p>
  
  <pre><code>    var url = 'http://10.10.9.169/UserService3/WebService1.asmx';
      $http.get(url + '/getCardsbyUsername' + '?unameID=' + currentID ).success(function(response) {
      // stuff
          console.log('response is jsonobj = ' + response);
          var strObj = JSON.stringify(response).replace(/"(\w+)"\s*:/g, '$1:');
          var myObject = eval('(' + strObj + ')');
           $scope.cardNumbers = myObject;
           console.log('response is jsonarr = ' + $scope.cardNumbers);
      })
      .error(function(response) {
      // error stuff
          console.log('response error is = ' + response);
      });
  </code></pre>
  
  <p>here's the full code:</p>
  
  <pre><code>$scope.currentIdx = 0;
  
  var currentID = sharedProperties3.getUserID();
  console.log('current ID = ' + currentID);
  
  var url = 'http://10.10.9.169/UserService3/WebService1.asmx';
      $http.get(url + '/getCardsbyUsername' + '?unameID=' + currentID ).success(function(response) {
      // stuff
          console.log('response is jsonobj = ' + response);
          var strObj = JSON.stringify(response).replace(/"(\w+)"\s*:/g, '$1:');
          var myObject = eval('(' + strObj + ')');
           $scope.cardNumbers = myObject;
           console.log('response is jsonarr = ' + $scope.cardNumbers);
      })
      .error(function(response) {
      // error stuff
          console.log('response error is = ' + response);
      });
  
    $scope.options1 = {
      initialSlide: 0,
      onInit: function(slider1)
      {
          $scope.slider1 = slider1;
          sharedProperties.setProperty($scope.cardNumbers[$scope.currentIdx].CardNumber);
  
      },
      onSlideChangeEnd: function(slider1)
      {
          console.log('The active index is ' + slider1.activeIndex); 
          $scope.currentIdx = slider1.activeIndex;
          console.log('The active card is ' + $scope.cardNumbers[$scope.currentIdx].CardNumber); 
          sharedProperties.setProperty($scope.cardNumbers[$scope.currentIdx].CardNumber);
      }
      };
  
    $scope.options2 = {
    direction: 'vertical',
    slidesPerView: '1',
    pagination: false,
    initialSlide: 1,
    showNavButtons: false
    };
  </code></pre>
  
  <p>how can i make it pass through the $http.get code block first?</p>