Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to go to another page with a button click with ionic?

I have been trying to work with the code, I added the button but I don't know how to link it to another page when clicking on it.

like image 840
Bashayr Avatar asked Oct 25 '16 17:10

Bashayr


People also ask

How do you move from one page to another in Ionic 4?

ts file code. export class HomePage { constructor(public navController: NavController) { } goToLoginPage(){ this. navController. navigateForward(LoginVCPage) // Getting error at this line. } }

How do you make a button transparent in Ionic?

Set to "clear" for a transparent button that resembles a flat button, to "outline" for a transparent button with a border, or to "solid" for a button with a filled background. The default fill is "solid" except inside of a toolbar, where the default is "clear" .


1 Answers

html

<ion-button (click)="nextpage()">Home</ion-button>

ts


import { Router } from '@angular/router';


constructor(private route: Router) { }

  nextpage() {
    this.route.navigate(['/home']);
  }
like image 195
O.Moloi Avatar answered Oct 25 '22 02:10

O.Moloi