I trying to use ionic-back-button. When the app loads I am redirected to account page which is core.page.ts. In this page I have two button with routerlink login and sign up. When I click login button in core.page.html I get redirected to login page. The back button also appears. But when click on that back button it does nothing except that ripple effect. Am not sure why. Please help.
In my app.routing.module.ts
const routes: Routes = [
{
path: '',
redirectTo: 'account',
pathMatch: 'full'
},
{
path: 'account',
loadChildren: () => import('./core/core.module').then( m => m.CorePageModule)
}
];
In my core.routing.module.ts
const routes: Routes = [
{
path: '',
component: CorePage
},
{
path: 'login',
component: LoginComponent
},
{
path: 'register',
component: RegisterComponent
},
];
in my core.page.html
<div class="button_wrap">
<ion-button color="success" [routerLink]="['/account/register']" expand="block">Sign Up</ion-button>
<ion-button color="light" [routerLink]="['/account/login']" expand="block">Log In</ion-button>
</div>
In my login page
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-back-button defaultHref="/" icon="chevron-back-outline" text="Back"></ion-back-button>
</ion-buttons>
<ion-title>LOGIN</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<p> login works! </p>
</ion-content>
Similar stories mentioned here but no exact solution.