0

while using child routing in angular2 RC-4 getting this error

Cannot read property 'pathsWithParams' of undefined

my routing file contains

export const routes: RouterConfig = [
  { path: '', component: HomeComponent },
  { path: 'demo', component: DummyComponent },
  { path: 'user-profile', component: UserProfileComponent,
    children:[
      { path: '', component: ProfileOverview },
      { path: 'smart-points', component: ProfileSmartPoints }
    ]},
]

any idea ?

update

The problem is actully whenever i use routerLinkActive in the html side

Community
  • 1
  • 1
Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215

1 Answers1

2

Got the answer thanks @micronyks

actually the probelm is we have to use the property [routerLinkActiveOptions]="{exact: true}" while using routerLinkActive="active-link" in the html for checking active route.

so the correct syntax for this is :

<a routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}" [routerLink]='["./Dummy"]'>Dummy</a>
Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215