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

Angular 4 update: Behaviour of nsRouterLink has been changed slightly #724

Closed
JohannesHoppe opened this issue Mar 28, 2017 · 4 comments
Closed
Assignees
Labels

Comments

@JohannesHoppe
Copy link

JohannesHoppe commented Mar 28, 2017

Please take a look at this simple routing example:

const routes: Routes = [
  {
    path: 'books',
    component: BookListComponent
  },
  {
    path: 'books/:isbn',
    component: BookDetailsComponent
  }
];

With the normal Angular 4 router I can navigate from books to books/XXX via this link:

<a [routerLink]="theNumber"></a>

(full example here, demo here, tested on both Angular2/Router3 and Angular4/Router4)

Before upgrading this worked fine for nativescript-angular, too:

<StackLayout [nsRouterLink]="theNumber"></StackLayout>

(full example here)

But after upgrading to nativescript-angular@1.5.0 the router cannot match any routes. I had to change the link like this:

<StackLayout [nsRouterLink]="['books', theNumber]"></StackLayout>

(full example here)

This difference between nsRouterLink and the normal routerLink is not desired , isn't it?!

@JohannesHoppe
Copy link
Author

Great, I have seen relativeTo in the code.

Do you have an ETA for the patch on NPM?

@sis0k0
Copy link
Contributor

sis0k0 commented Mar 29, 2017

If everything is fine, we'll release 1.5.1 tomorrow.

@sis0k0
Copy link
Contributor

sis0k0 commented Mar 30, 2017

Fixed with 1.5.1 patch.

@JohannesHoppe
Copy link
Author

I can confirm this. Thanks for the super-fast fix! 👍

sis0k0 added a commit that referenced this issue Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants