Nativescript-angular: [nsRouterLink] not working in view but navigate working in component

Created on 12 Sep 2016  路  3Comments  路  Source: NativeScript/nativescript-angular

Hi,

After upgrading to ng2-rc6 and nativescript-angular 0.5.0 all the [nsRouterLink] inline links in my templates are not working. So this does not work:

<Button text="Settings" [nsRouterLink]="['/settings']"></Button>

But this does:

<Button text="Settings" (tap)="goSettings()"></Button>

goSettings() {
    this._router.navigate(["/settings"]);
}

Any ideas on what is causing this issue?

Thanks

Most helpful comment

Ok so the fix is on every single module, this must be imported:

import { NativeScriptRouterModule } from "nativescript-angular/router";

And then add that to the imports.

All 3 comments

I confirm this is occurring with the sample-groceries project if I add in a nsRouterLink

hey @bnussey

We are using [nsRouterLink] in this sample app and it works as expected (with RC6 and nativescript-angular 0.5.0) (Perhaps you can provide us with some more code to reproduce your case)

Ok so the fix is on every single module, this must be imported:

import { NativeScriptRouterModule } from "nativescript-angular/router";

And then add that to the imports.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sunpasup picture sunpasup  路  3Comments

Sulman633 picture Sulman633  路  3Comments

vakrilov picture vakrilov  路  3Comments

manojdcoder picture manojdcoder  路  3Comments

tsonevn picture tsonevn  路  3Comments