繁体   English   中英

routerLink 在我的 angular 离子项目中不起作用

[英]the routerLink doesn't work in my angular ionic project

我正在尝试创建一个 angular 离子项目,所以我创建了一个名为 ident 的模块来将登录和订阅组件放在上面,当我创建路由器在两个组件之间循环时它不起作用并且没有向我显示错误

离子V 6.12.3

ident-app-routing.ts 并登录 HTML

 const routes: Routes = [ { path: 'Login', component: LoginComponent }, { path:'', redirectTo:'Login', pathMatch:'full' }, { path:'Signup', component:InscritComponent } ];
 <ion-buttons slot="end"> <ion-button (click)="test()" [routerLink]="['/Signup']">Signup</ion-button> </ion-buttons>

i.net.html

<ion-router-outlet></ion-router-outlet>

请尝试routerLink="/Signup"

单击时,您将同时为按钮分配两个操作:

  • test(),当用户点击按钮时从.ts文件中调用
  • routerLink,它使用 RouterModule 切换到其他页面

暂无
暂无

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

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