Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condition using urlPath, component is null on UnresolvedException of … #7755

Closed
wants to merge 2 commits into from
Closed

Conversation

wellingWilliam
Copy link

bug fix

  • What is the current behavior? (You can also link to an open issue here)

The generated href is incomplete when server side rendering of *ngFor templating routerLink with path, child component, and route parameter from a xhr request. The child route being an AsyncRoute.

#7752

angular/universal#330

  • What is the new behavior (if this is a feature change)?

The path parameter of the AsyncRoute being append to the href of the anchor tag generated from the routerLink directive.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No. The property of the UnresolvedException being used upon the true condition is the urlPath therefor if the urlPath is blank the desired result is still correct.

  • Other information:

…child AsyncRoute.

@wellingWilliam
Copy link
Author

In route_registry the following code explains how the instruction will be resolved when the navigation occurs.

// Create an "unresolved instruction" for async routes
// we'll figure out the rest of the route when we resolve the instruction and
// perform a navigation
if (lang_1.isBlank(routeRecognizer.handler.componentType)) {
    var generatedUrl = routeRecognizer.generateComponentPathValues(routeParams);
    return new instruction_1.UnresolvedInstruction(function () {
        return routeRecognizer.handler.resolveComponentType().then(function (_) {
            return _this._generate(linkParams, ancestorInstructions, prevInstruction, _aux, _originalLink);
        });
    }, generatedUrl.urlPath, url_parser_1.convertUrlParamsToArray(generatedUrl.urlParams));
}

This makes me feel that the condition to append the urlPath within the recursion be if the component or the resolver exists.

This problem seems to only be a concern for server side rendering when the navigation is performed by the href and not a router action. I found it not appending the route parameter for any type of route however when rendered on the server.

I am unsure on where and what solution is appropriate for this.

@mhevery mhevery closed this in 9019c6f May 19, 2016
KiaraGrouwstra pushed a commit to KiaraGrouwstra/angular that referenced this pull request Jun 10, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants