title: AngularJS - what is $transitions?
body: <p>Currently working on a AngularJS + NodeJS app when all of a sudden I see this code:</p>
  
  <pre><code>    $transitions.onStart({exiting: 'orders.view'}, function(trans) {
          Socket.emit('orders:leave', {id_order: trans.params('from').id_order});
      });
  </code></pre>
  
  <p>Help me find what does <code>$transitions</code> eat for lunch.</p>
  
  <p>Thanks.</p>
  
  <p><br>
  <strong>After answer edits:</strong></p>
  
  <p>For those who end up landing here, you can basically do whatever you want in those transitions; Including doing some things when you exit X state.</p>
  
  <pre><code>'use strict';
  
  // Configuring the orders module
  angular.module('orders').run(['Menus','MODULE_LIST', 'Authentication', '$transitions', 'Socket', '$templateCache',
      function(Menus, MODULE_LIST, Authentication, $transitions, Socket, $templateCache) {
  
          $transitions.onStart({exiting: 'orders.view'}, function(trans) {
            alert('Alert function has stopped you from going further BEEP BOOP')
            Socket.emit('orders:leave', {id_order: trans.params('from').id_order});
          });
  
          var stlViewPopoverHtml =
              '&lt;div&gt;' +
              '&lt;img ng-src="{{url}}" height="{{height}}" width="{{width}}"&gt;' +
              '&lt;/div&gt;';
  
          $templateCache.put('stl-preview-popover.html', stlViewPopoverHtml);
      }
  ]);
  </code></pre>