title: Cannot read property 'go' of undefined
body: <p>I'm new to <code>angularjs</code> </p>
  
  <p>Even though i have specified <code>$state</code> in the controller state is not changing it's showing </p>
  
  <blockquote>
    <p>angular.js:11594 TypeError: Cannot read property 'go' of undefined. </p>
  </blockquote>
  
  <p>Any answers will be helpful. Thanks if any.</p>
  
  <p>Here is the code:</p>
  
  <pre><code> .controller('ManageCtrl',['$scope','smanageFactory','fileUpload', function($scope,smanageFactory,appConfig,$state,$modal,fileUpload) {
  
  
  $scope.doFetching= function(studentId, vehicleId){
       smanageFactory.doFetching(studentId,vehicleId).fetch({},function(response){
              $scope.classroom_list =[];
              console.log(response);
              if(response.status == 200 || response.status == 201){
                  $state.go('^.list');
                  $scope.fetchYearList();
              }
              $scope.response_msg = "successful !!!.";
          },function(response){
              $scope.response_msg1 = "Unsuccessful !!!.";
  
          });
      };
  });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/OPmkr.png" alt="enter image description here"></p>
  
  <p>Any answers will be appriciated thanks to all</p>