title: Get current state in ionic app
body: <p>Newbie to the whole ionic and angular scene.
  I used the ionic creator to generate the view files.
  My goal is to check if the user is logged in before proceeding in to a tab.
  However, before getting to the authentication part, I wanted to check which window the user is on.
  I am trying to use a simple alert/console.log to identify the progress.</p>
  
  <p>Below is my code.</p>
  
  <pre><code>.controller('adminPageCtrl', ['$scope', '$stateParams', '$state', function     ($rootScope, $scope, $stateParams, $state) {
      //alert($state.current.name);
      $scope.currState = $state;
      var currentState = $state.current.name; 
      console.log($state);
  }])
  </code></pre>
  
  <p>I have come across the below error which i cant seem to make heads or tails.
  "ionic.bundle.js:26799 TypeError: Cannot read property 'current' of undefined".</p>
  
  <p>Any help is greatly appreciated.
  Even the console.log($state); command returns "undefined".</p>