Onclick functionalities in button


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() {


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


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

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");



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:


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



Thank You Very Much Sir


Hi, @ApproTechnologies

if your issue resolved plz mark as solution.