Onclick functionalities in button

#1

Please help me on onclick functionalities
this is my html code:
<button ion-button class=“large” (click)=“Addcc()”>Add CC
this is my ts code:
Addcc() {
this.navCtrl.push(AddccPage);
}

#2

Hi, @ApproTechnologies
Can you please send me the full code of requestannualleave3.page.ts in format.

#3

import { Component, OnInit } from ‘@angular/core’;
import { AlertController, NavController } from ‘@ionic/angular’;

@Component({
selector: ‘app-requestannualleave3’,
templateUrl: ‘./requestannualleave3.page.html’,
styleUrls: [’./requestannualleave3.page.scss’],
})
export class Requestannualleave3Page implements OnInit {
Requestleave: string;
constructor(public alertController: AlertController,public navCtrl: NavController) {
this.Requestleave = “Preview”;
}

ngOnInit() {
}
async presentAlert() {
const alert = await this.alertController.create({
header: ‘Confirm’,
message: ‘Are you sure you want to send this request .’,
buttons: [‘OK’, ‘CANCEL’]
});

    await alert.present();
}
Addcc() {
    this.navCtrl.push("Add cc");
}

}

#4

I think your Addcc function is not same in that screenshot and the code you have sent to me so you need to check that first and if your Addcc function is as per the code in reply then you need to write like this:

Addcc(){
 this.navCtrl.push(AddccPage);
}

And also let me know your ionic version ionic -v.

Thanks!

#5

Thank You Very Much Sir

#6

Hi, @ApproTechnologies

if your issue resolved plz mark as solution.

thanks