简体   繁体   English

Angular2:routerLink指令不起作用(不重定向)

[英]Angular2: routerLink directive is not working (not redirecting)

My routerlink seems to be fine yet it's not doing anything. 我的routerlink似乎还不错,但是它什么也没做。 When I click the element it's not redirecting me at all. 当我单击该元素时,它根本不会重定向我。 What am I doing wrong? 我究竟做错了什么?

<div class="tile" routerLink="/risk-profiler/upload">

Check if you are importing the RouterModule: 检查是否要导入RouterModule:

import { RouterModule } from '@angular/router'

@NgModule({
  ...
  imports: [ RouterModule ]
  ...
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM