Can't bind to 'routerLink' since it isn't a known property

后端 未结 9 896
别那么骄傲
别那么骄傲 2020-12-12 14:16

Recently, I have started playing with angular 2. It\'s awesome so far. So, i have started a demo personal project for the sake of learning using angular-cli. <

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-12 14:46

    I'll add another case where I was getting the same error but just being a dummy. I had added [routerLinkActiveOptions]="{exact: true}" without yet adding routerLinkActive="active".

    My incorrect code was

    
      Home
    
    

    when it should have been

    
      Home
    
    

    Without having routerLinkActive, you can't have routerLinkActiveOptions.

提交回复
热议问题