【问题标题】:the routerLink doesn't work in my angular ionic projectrouterLink 在我的 Angular 离子项目中不起作用
【发布时间】:2021-03-30 19:33:14
【问题描述】:

我正在尝试创建一个角度离子项目,所以我创建了一个名为 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>

idnet.html

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

【问题讨论】:

  • 请详细说明“它不起作用”。究竟发生了什么?或者,您到底期望什么没有发生?是否显示了一页而另一页没有显示?或者,他们都没有出现?
  • 是的,只有登录页面显示给我

标签: javascript angular ionic-framework angular-ui-router


【解决方案1】:

请尝试routerLink="/Signup"

【讨论】:

    猜你喜欢
    • 2018-06-06
    • 2018-11-25
    • 1970-01-01
    • 2016-12-18
    • 2020-01-30
    • 1970-01-01
    • 2020-11-10
    • 2017-04-24
    • 1970-01-01
    相关资源
    最近更新 更多