2016-08-04 6 views
4

OKボタンで$ ionicPopup.promptを使用していますが、入力オプションが選択されていないとプログラムで無効にしようとしています。

私が入れても:attr: 'ng-disabled = "true"'それは効果がありません。私が期待するのは、[OK]ボタンを無効にして、入力オプションの1つが選択されるまでポップアップを画面に残すことです。

例えば、

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

答えて

2

あなたは、直接ではなくattr: 'ng-disabled="true" 'を使用するよりもbuttons:nullを使用することができます。 buttons:nullはあなたのポップアップからokボタンを削除します...

関連する問題