文章内容
2019/8/5 17:13:09,作 者: 黄兵
Can't bind to 'routerLink' since it isn't a known property of 'a'.
在使用routerLink跳转的时候出现如下错误:
Can't bind to 'routerLink' since it isn't a known property of 'a'.
出现错误的原因:
忘记添加RouterModule
到NgModule
组件中。
解决方案:
将RouterModule
添加到NgModule
组件中,具体代码如下:
import {RouterModule} from '@angular/router'; @NgModule({ imports: [ SharedModule, RouterModule ], declarations: [ PayResultComponent ] }) export class PayResultModule { }
参考资料:
1、Can't bind to 'routerLink' since it isn't a known property of 'a' [duplicate]
黄兵个人博客原创。
转载请注明出处:黄兵个人博客 - Can't bind to 'routerLink' since it isn't a known property of 'a'.
评论列表