title: Add reference to $state and $stateParams to $rootScope in Typescript (angular)
body: <p>I'm trying to set the page title of my angular app based on data of the current state (configured in ui-router).</p>
  
  <pre><code> &lt;title ng-bind="$state.current.data.pageTitle&gt;&lt;/title&gt;
  </code></pre>
  
  <p>On this <a href="https://stackoverflow.com/questions/23813599/set-page-title-using-ui-router">link</a>, I found the following to add a reference to $state/$stateParams to the root scope:</p>
  
  <pre><code>.run([ '$rootScope', '$state', '$stateParams',
      function ($rootScope, $state, $stateParams) {
          $rootScope.$state = $state;
          $rootScope.$stateParams = $stateParams;
      }])
  </code></pre>
  
  <p>How can I translate this to typescript?</p>
  
  <pre><code> function run($rootScope: ng.IRootScopeService, $state : ng.ui.IState, $stateParams : ng.ui.IStateParamsService) {
      $rootScope.$state // 'state' cannot be resolved
  }
  </code></pre>