title: Define the onEnter and onExit callbacks in another file with Angular UI Router
body: <p>I have a simple application using Angular UI Router with some states.</p>
  
  <p>Actually I have this kind of code in my router :</p>
  
  <pre><code>$stateProvider.state('map.layers', {
      url: '/layers',
      templateUrl: 'views/layers.html',
      controller: 'LayersCtrl',
      onEnter: function(map: Master.Map) {
        // do stuff
      },
  
      onExit: function(map: Master.Map) {
        // do stuff
      }
    });
  </code></pre>
  
  <p>The controller is defined in another file, and I'm looking for a good way to define the onEnter and onExit callbacks in the same file.</p>
  
  <p>In your opinion, what is the best solution ? A global variable should work but it's not very beautiful.</p>