My @RouteConfig code broke when going from Angular 2 alpha 45 to alpha 46. 
I get errors like:

Argument of type '{ path: string; component: typeof UserPreferences; as: 
string; }' is not assignable to parameter of type '{ path: string; 
component: Type; name?: string; data?: { [key: string]: any; }; }'.
  Object literal may only specify known properties, and 'as' does not exist 
in type '{ path: string; component: Type; name?: string; data?: { [key: 
string]: any; }; }'.

[Similar error for each "new Route" in my @RouteConfig]

My code:

import { ROUTER_PROVIDERS, ROUTER_DIRECTIVES, ROUTER_PRIMARY_COMPONENT, 
RouteConfig, RouterLink, RouterOutlet,
  Route, LocationStrategy, HashLocationStrategy
} from 'angular2/router';


[...]



@RouteConfig([
    new Route({path: '/', component: Home, as : 'Home'}),
 new Route({path: '/home', component: Home, as : 'Home'}),
 new Route({path: '/report', component: Report, as : 'Report'}),
 new Route({path: '/study/:id', component: Study, as : 'Study'}),
 new Route({path: '/prefs', component: UserPreferences, as : 'Prefs'})  
])


[...]


bootstrap(CSReportMain, [
  ROUTER_PROVIDERS, 
  provide(ROUTER_PRIMARY_COMPONENT, {useValue: CSReportMain}),
  provide(LocationStrategy, {useClass: HashLocationStrategy})
]);




I don't see any mention of this in breaking changes for alpha 46:

https://github.com/angular/angular/blob/master/CHANGELOG.md

but it does mention a new AuxRoute addition. I don't know what that is.

Any idea how I'm supposed to change my "new Route" syntax?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to