title: UI Router $state.go throwing $stateChangeError
body: <p>I'm running into an issue (I think) with UI-Router v0.4.2 throwing the following error, when I attempt to run a <code>$state.go();</code></p>
  
  <blockquote>
    <p>14:57:22.563 Error: [$http:badreq] Http request configuration url must be a string.  Received: ["$stateParams",null]
    <a href="http://errors.angularjs.org/1.5.8/" rel="nofollow noreferrer">http://errors.angularjs.org/1.5.8/</a>$http/badreq?p0=%5B%22%24stateParams%22%2Cnull%5D
    Stack trace:
    minErr/&lt;@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:68:12" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:68:12</a>
    $http@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:11439:15" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:11439:15</a>
    createShortMethods/http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:11698:18
    handleRequestFn@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:19419:14" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:19419:14</a>
    TemplateFactory/this.fromUrl@<a href="http://localhost:3001/vendor.js:1488:16" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1488:16</a>
    TemplateFactory/this.fromConfig@<a href="http://localhost:3001/vendor.js:1444:39" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1444:39</a>
    load@<a href="http://localhost:3001/vendor.js:4586:20" rel="nofollow noreferrer">http://localhost:3001/vendor.js:4586:20</a>
    resolveViews/http://localhost:3001/vendor.js:4479:20
    invoke@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:4718:16" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:4718:16</a>
    proceed@<a href="http://localhost:3001/vendor.js:1266:32" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1266:32</a>
    invoke@<a href="http://localhost:3001/vendor.js:1262:26" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1262:26</a>
    $Resolve/this.study/&lt;@<a href="http://localhost:3001/vendor.js:1241:14" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1241:14</a>
    $Resolve/this.resolve@<a href="http://localhost:3001/vendor.js:1345:12" rel="nofollow noreferrer">http://localhost:3001/vendor.js:1345:12</a>
    resolveViews/&lt;@<a href="http://localhost:3001/vendor.js:4482:30" rel="nofollow noreferrer">http://localhost:3001/vendor.js:4482:30</a>
    forEach@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:335:11" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:335:11</a>
    resolveViews@<a href="http://localhost:3001/vendor.js:4476:9" rel="nofollow noreferrer">http://localhost:3001/vendor.js:4476:9</a>
    processQueue@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16383:28" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16383:28</a>
    scheduleProcessQueue/&lt;@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16399:27" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16399:27</a>
    $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17682:16
    $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17495:15
    $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17790:13
    ngEventHandler/&lt;@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:25890:17" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:25890:17</a>
    defaultHandlerWrapper@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3497:3" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3497:3</a>
    createEventHandler/eventHandler@<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3485:9" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3485:9</a>
    1 script.js:1301:13   
    <a href="http://localhost:3001/app/script.js:1301:13" rel="nofollow noreferrer">http://localhost:3001/app/script.js:1301:13</a>
      $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:18005:15
      transitionTo/$state.transition&lt;
    <a href="http://localhost:3001/vendor.js:4245:15" rel="nofollow noreferrer">http://localhost:3001/vendor.js:4245:15</a>   processQueue
    <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16383:28" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16383:28</a>
      scheduleProcessQueue/&lt;
    <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16399:27" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:16399:27</a>
      $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17682:16
      $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17495:15
      $RootScopeProvider/this.$gethttp://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:17790:13
      ngEventHandler/&lt;
    <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:25890:17" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:25890:17</a>
      defaultHandlerWrapper
    <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3497:3" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3497:3</a>
      createEventHandler/eventHandler
    <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3485:9" rel="nofollow noreferrer">http://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js:3485:9</a></p>
  </blockquote>
  
  <p>The route, looks like this:</p>
  
  <pre><code>.state('foo.bar', {
      url: '/:type/:id',
      views: {
          'question': {
              templateUrl: ['$stateParams', function (stateParams) {
                  var qID = stateParams.id;
                  var template = qID + '.tmpl.html';
                  var url = "app/section/foo/";
  
                  return qID &lt;= 7 ? url + 'general/' + template : url + stateParams.type + "/" + template;
              }]
          }
      }
  })
  </code></pre>
  
  <p>And I'm using this to try and go to the state: </p>
  
  <pre><code>$state.go('foo.bar', {
      type: 'typeA',
      id: 1
  });
  </code></pre>