title: Transition to different state with state params
body: <p>Hi I am new to angular routing and was wondering how I can transition to different states through controllers.</p>
  
  <p>I know that I must inject the $state service which I did but I am unclear on how to use the transition method for the service.</p>
  
  <p>This is what I have in my controller code to try to transition but it is not working :( (I tried to $stateService.go(...) as well but no success)</p>
  
  <pre><code>$stateService.transitionTo("teststate({ path: 'Test.TestState' })");
  </code></pre>
  
  <p>Here is my state definition</p>
  
  <pre><code>    $stateProvider
          .state("teststate",
          {
              url: '/:path',
              templateUrl: (stateParams) =&gt; {
                  return '/Templates?path=' + stateParams.path;
              },
          })
  </code></pre>
  
  <p>Any help would be appreciated!</p>
  
  <p>Thanks</p>