how to link a button to a page in ionic 3

 

1. Generate new page in ionic

Example: ionic g page about

2. create a button

HTML

<button ion-button (click)="openAboutPage()">Button</button>

 

3. app.module.ts

add your page to app module ( plz focus on Aboutpage)

add your page to app module

 

4.  TS file ( if you include your new button in home.html then do this changes in home.ts)

First, you have to import your page.

import { AboutPage } from '../about/about';

also don’t forget to add this to your constructor.

constructor(public navCtrl: NavController) { }

navigate application to particular page

openAboutPage(){
this.navCtrl.push(AboutPage);
}

 

 

Overview in Video

Click Her

 

 Result

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

admin
Leave a Reply

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages