What is the best practice for save the target path to go to it after registration?

3 years later, and as far as I can tell, still no reliable/easy way to get the URL from from the Transition object.

Without any documentation, it’s hard to figure out how to use the generate method. Here’s an answer on stackoverflow that has working example invocation.

Personally, I simplified this approach with some lodash methods:

    let params = merge({}, ...values(transition.params));
    let url;
    if(isEmpty(params)) {
      url = transition.router.generate(transition.targetName);
    } else {
      url = transition.router.generate(transition.targetName, params);
    }

(generate gets angry if you pass it {} for params)