# Onclick functionalities in button

**URL:** <https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212>\
**Category:** ionic-v1\
**Created:** [March 5, 2019, 6:20am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212 "2019-03-05T06:20:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ApproTechnologies](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@ApproTechnologies](https://forum.ionicframework.com/u/ApproTechnologies)\
**Post date:** [March 5, 2019, 6:20am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/1 "2019-03-05T06:20:36Z")

</div>

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

 ![1](https://global.discourse-cdn.com/ionicframework/original/3X/a/d/ad0b9ee7090cda57849670dd9faca118c5da0350.png)

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/addwebsolution/32/120392_2.png) [@addwebsolution](https://forum.ionicframework.com/u/addwebsolution)\
**Post date:** [March 5, 2019, 6:40am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/2 "2019-03-05T06:40:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ApproTechnologies](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@ApproTechnologies](https://forum.ionicframework.com/u/ApproTechnologies)\
**Post date:** [March 5, 2019, 9:35am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/3 "2019-03-05T09:35:32Z")

</div>

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

```

}

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/addwebsolution/32/120392_2.png) [@addwebsolution](https://forum.ionicframework.com/u/addwebsolution)\
**Post date:** [March 5, 2019, 9:51am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/4 "2019-03-05T09:51:43Z")

</div>

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:

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

```

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

Thanks!

---

<div class="post-metadata">

**Author:** ![ApproTechnologies](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@ApproTechnologies](https://forum.ionicframework.com/u/ApproTechnologies)\
**Post date:** [March 5, 2019, 11:02am UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/5 "2019-03-05T11:02:08Z")

</div>

Thank You Very Much Sir

---

<div class="post-metadata">

**Author:** ![addwebsolution](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/addwebsolution/32/120392_2.png) [@addwebsolution](https://forum.ionicframework.com/u/addwebsolution)\
**Post date:** [March 5, 2019, 12:48pm UTC](https://forum.ionicframework.com/t/onclick-functionalities-in-button/158212/6 "2019-03-05T12:48:19Z")

</div>

Hi, @ApproTechnologies

if your issue resolved plz mark as solution.

thanks
