# $ionicActionSheet change button text on click

**URL:** <https://forum.ionicframework.com/t/ionicactionsheet-change-button-text-on-click/17650>\
**Category:** ionic-v1\
**Created:** [February 15, 2015, 2:55pm UTC](https://forum.ionicframework.com/t/ionicactionsheet-change-button-text-on-click/17650 "2015-02-15T14:55:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomo03](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@thomo03](https://forum.ionicframework.com/u/thomo03)\
**Post date:** [February 15, 2015, 2:55pm UTC](https://forum.ionicframework.com/t/ionicactionsheet-change-button-text-on-click/17650/1 "2015-02-15T14:55:58Z")

</div>

Hello all.

I’m wondering how I would change the text on a button.

So I have the following:

```
$scope.watchThisModel = '<b ng-model="watchThisModel">'+ 'watch' + ' <span class="ion ion-eye" style="font-size:40pt"></span></b>';
 $ionicActionSheet.show({
 
         destructiveText: '<b>report this</b>',
         titleText: 'I want to...',
         cancelText: 'Cancel',
         buttons: [
          {text: '<b>share this <span class="ion ion-share" style="font-size:40pt"></span></b>'},
          

 **{text: $scope.watchThisModel }**

         ],
         cancel: function() {
              // add cancel code..
            },
buttonClicked: function(index) {
          if(index === 1){
            $timeout(function() {
            itemsService.watchItem(itemId)
              .then(function(data){
             //......HERE I want to be able to change the text of the second button

```

The Action Sheet is in a list of others, so I’ve tried all sorts like finding the index of the ActionSheet and changing it that way, but I’m getting nowhere.

Please let me know if this isn’t a clear question (it makes sense in my head!)

Many thanks

---

<div class="post-metadata">

**Author:** ![joseadrian](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/joseadrian/32/71106_2.png) [@joseadrian](https://forum.ionicframework.com/u/joseadrian)\
**Post date:** [February 15, 2015, 3:45pm UTC](https://forum.ionicframework.com/t/ionicactionsheet-change-button-text-on-click/17650/2 "2015-02-15T15:45:11Z")

</div>

Inside **buttonClicked** function use this:

```
if(index = 1)
{
  this.buttons[1].text = 'Whatever you want';
  return false;
}
```

---

<div class="post-metadata">

**Author:** ![thomo03](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@thomo03](https://forum.ionicframework.com/u/thomo03)\
**Post date:** [February 15, 2015, 4:02pm UTC](https://forum.ionicframework.com/t/ionicactionsheet-change-button-text-on-click/17650/3 "2015-02-15T16:02:42Z")

</div>

Perfect, annoying because it was so easy!

Thank you for your help!!
