NativeScript / nativescript-angular

Integrating NativeScript with Angular
http://docs.nativescript.org/angular/tutorial/ng-chapter-0
Apache License 2.0
1.21k stars 241 forks source link

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

Closed JohannesHoppe closed 7 years ago

JohannesHoppe commented 7 years ago

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 commented 7 years ago

Great, I have seen relativeTo in the code.

Do you have an ETA for the patch on NPM?

sis0k0 commented 7 years ago

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

sis0k0 commented 7 years ago

Fixed with 1.5.1 patch.

JohannesHoppe commented 7 years ago

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