Skip to content

RouterExtensions.navigateByURL() broken when passing queryParams #2350

Open
@jalberto-ghub

Description

@jalberto-ghub

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.2.1
  • Cross-platform modules: 7.1.4
  • Android Runtime: 7.0.1
  • iOS Runtime: 7.2.0
  • Plugin(s):
  • NativeScript-Angular: 10.1.7
  • Angular: 10.2.x

Describe the bug

The options are not passed to the Angular router, which means there is no way to specify NavigationExtras on file router-extensions.js here:

public navigateByUrl(url: string | UrlTree, options?: NavigationOptions): Promise<boolean> { if (options) { this.locationStrategy._setNavigationOptions(options); } return this.router.navigateByUrl(url); }
To Reproduce

Try passing query parameters on this call, you will see they are not available to your ActivatedRouteSnapshot on your routes or guards. All the options for NavigationExtras are ignored.

Expected behavior
The query parameters should be available.

Additional context
It is broken on the latest version of N8 also.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jalberto-ghub

        Issue actions

          RouterExtensions.navigateByURL() broken when passing queryParams · Issue #2350 · NativeScript/nativescript-angular