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);
}
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’;
@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");
}
}
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!
Thank You Very Much Sir