I am trying to store the "next route" argument of $routeChangeStart inside a service and call $location.path() with the "next route" from a different place. To clarify here some code:
$scope.$on('$routeChangeStart', function (event, next, current) {
    service.nextRoute = next;
    $rootScope.$broadcast('event:someEvent');
});
...now I catch the event and try to do something like (assume that the services used are all properly injected and available):
$rootScope.$on('event:someEvent', function() {
    //do some stuff
    $location.path(service.nextRoute);
});
what I get is a TypeError: Object #<Object> has no method 'charAt' error from the call to $locaton.path(service.nextRoute);. There is another post here on StackOverflow with a similar problem but the proposed solution doesn't seem to work? So what am I doing wrong?
Thanks
 
     
    