-1

So I decided to retry the angular2 tutorial, since last time I had some issues with the router (sound familiar?). See link: Angular 2 tutorial Where I followed every step, got everything to work, until I got to the redirect section.

{
  path: '',
  redirectTo: '/dashboard',
  pathMatch: 'full'
},

Where it hangs on the "pathMatch". Even when I try to restart with "npm start" in the command window, I get this error:

app/app.routes.ts(11,5): error TS2322: Type '({ path: string; redirectTo: string; pathMatch: string; } | { path: string; component: typeof Das...' is not assignable to type 'Route[]'.

My router version defined in package.json is: "@angular/router": "3.0.0-alpha.7", of which i thought was the latest version?

How can I check which routerversion is actually installed on my project/pc? I'm kind of new to the whole npm-deal and I'm getting stumped trying to figure this thing out. I'm guessing I may have an old router version?

Thanks in advance for helping me out.

8

1 Answer 1

1

Okay I guess you should have found the answer by now, but here is how you can check which version of router is installed on your system

Go into node_modules folder and then into @angular, and into router

node_modules/@angular/router
├── README.md
├── bundles
├── index.d.ts
├── index.js
├── index.js.map
├── index.metadata.jsenter code hereon
├── package.json <----------- This file should tell you the Version
├── src

I hope your problem was solved. Thanks.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for providing that answer!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.