Angular2(RC-4) :Cannot read property 'pathsWithParams' of undefined

前端 未结 1 1911
抹茶落季
抹茶落季 2021-01-26 09:11

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

Cannot read property \'pathsWithParams\' of undefined

my routing file cont

相关标签:
1条回答
  • 2021-01-26 09:40

    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>
    
    0 讨论(0)
提交回复
热议问题