4

I'm using $ionicPopup.prompt with OK button, which I try to disable programmatically if none of the input option is selected.

Even if I put: attr: 'ng-disabled="true" ' it has no effect. What I expect is for the OK button to be disabled and the popup to remain on the screen until one of the input options is selected.

eg.

$ionicPopup.prompt({
                    title: '<h3>BLAH</h3>',
                    subTitle: '<h3>Please select one of the following options:</h3>',
                    template: 'BLAH BLAH <br>\n\</span>',
                    scope: $scope,
                    buttons: [
                        {   text: '<b>OK</b>', 
                            type: 'button-positive', 
                            attr: 'ng-disabled="true"',
                            onTap: function(res) {
                                    return true;
                                }
                            }}
                    ]
                }).then(function(res) {
                 ;//BLAH

                }, function(err) {
                    console.log('Err:', err);
                }, function(msg) {
                    console.log('message:', msg);
                });
Alex
  • 187
  • 1
  • 6

1 Answers1

2

You can directly use buttons:null rather than using attr: 'ng-disabled="true" '. buttons:null will remove ok button from your popup...

skypjack
  • 49,335
  • 19
  • 95
  • 187
Swagat
  • 709
  • 3
  • 9
  • 27