title: AngularJS Variable is Undefined
body: <p>So my code looks like this</p>
  
  <pre><code>.controller('weinDetailsCtrl', ['$scope', '$stateParams', '$http', '$rootScope',function ($scope, $stateParams, $http, $rootScope) {
  
  $scope.url = "https://winetastic.azurewebsites.net/tables/Wine/" + $rootScope.actWine + "?ZUMO-API-VERSION=2.0.0";
  $scope.Winet;
  
  $http({
      method: "GET",
      url: $scope.url
  }).then(function mySucces(response) {
  
      $scope.wineDetails = response.data;
      $scope.Winet = $scope.wineDetails.Winetype_ID;
      alert($scope.Winet);
  
  
  }, function myError(response) {
      $scope.wineDetails = response.statusText
  });
  
  alert($scope.Winet);}])
  </code></pre>
  
  <p>the first alert gave me the right WineType_ID, the second alert give me an 'Undefined'.
  What's wrong?</p>