title: angularjs with jasmine- TypeError: $controller is not a function
body: <p>Here is my controller:</p>
  
  <pre><code>angular.module('someapp', [])
        .controller('TestCtrl', function($scope, dataservice, $stateParams) {
             $scope.messageid = parseInt($stateParams.messageid);
  });
  </code></pre>
  
  <p><strong>spec file:</strong></p>
  
  <pre><code>describe('TestCtrl', function() {
      beforeEach(module('someapp'));
  
      var $controller;
      $stateParameters = { messageid: 100 };
      beforeEach(inject(function(_$controller_){
          $controller = _$controller_;
      }));
  
      it('should set value of messageid', function() {
          var controller = $controller('TestCtrl', {
              $stateParams: $stateParameters
          });
          expect($scope.messageid).toEqual($stateParameters.messageid);
      });
  });
  </code></pre>
  
  <p>But it's giving error: <code>TypeError: $controller is not a function</code></p>
  
  <p>can anyone help me to resolve this?</p>