我正在使用带有 OK 按钮的 $ionicPopup.prompt,如果没有选择任何输入选项,我会尝试以编程方式禁用它。
即使我把: attr: 'ng-disabled="true"' 它没有效果。我期望的是禁用确定按钮并且弹出窗口保留在屏幕上,直到选择了输入选项之一。
例如。
$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);
});
最佳答案
您可以直接使用buttons:null
而不是使用 attr: 'ng-disabled="true" '
. buttons:null
将从您的弹出窗口中删除确定按钮...
关于带有 ng-disable 属性的 angularjs $ionicPopup.prompt OK 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38776118/