Import router issues

nativescriptrocks
nativescriptcore

#1

Hi,
Is my first app with nativescript, but in the file app.components,ts when i import NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS from “nativescript-angular/router/ns-router”;

import {NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS} from “nativescript-angular/router/ns-router”;

Plz can you help me to solve this error, see attached image


#2

Try importing like this
import { NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS } from “nativescript-angular/router”;

You don’t need that ns-router at the end of the import statement.
That might have been auto imported for you. I’ve noticed that auto import can cause such problems sometimes.

I would recommend you to take a look at the hello world template project


#3

Thanks @multishiv19
Same issue …
import { NS_ROUTER_DIRECTIVES, NS_ROUTER_PROVIDERS } from “nativescript-angular/router”;


#4

Not sure why it isn’t resolving for you.
Does it fail to compile?