4

@RouteConfig seems to have disappeared from angular2 2.0.0-rc.1, @RouteConfig is in the @angular/router-deprecated package, idem on the api documented on the site,

So what is the proper way to defines routes now?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1568220
  • 1,018
  • 1
  • 8
  • 10

1 Answers1

7

Check the changlog on github: https://github.com/angular/angular/blob/master/CHANGELOG.md

The router you're using is deprecated and now referred to as router-deprecated package that need to be installed separately for backward compatibility. Instead of RouteConfig use the new Routes imported from '@angular/router' (aka new router).

It's still missing a few features, such as route name and data, but they might add those in future.

  • i might not using routes the proper way, but those 2 changes (name and data) are quite usefull ... let's go on !! – user1568220 May 06 '16 at 21:03
  • just for fun : "...One caveat is that we could no more refer to a route by name ..." ...I agree... – user1568220 May 06 '16 at 21:40
  • I've asked them to put `data` back since sometimes you don't want to pass data via URL but behind the scene. Or provide another way for doing that: https://github.com/angular/angular/issues/8515 –  May 06 '16 at 21:47
  • Route name still missing? – Richard Peck Oct 06 '16 at 10:51