Here is the code :
var map = new google.maps.Map(document.getElementById(\"map_canvas\"), $scope.map_options);
var dirService= new google.maps.DirectionsServ
UPDATE
from this post in the v3 API group
There is no event. There is a feature request to add that to the API:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=3565
There should be a routeIndex_changed event, but that doesn't seem to work (and isn't documented). routeindex_changed does work, but I don't see it in the documentation.
http://www.geocodezip.com/v3_SO_simpleMap_directions_changed.html
Here is the event :
google.maps.event.addListener(dirRenderer, 'routeindex_changed',
function() {
alert(dirRenderer.getRouteIndex());
});