sweetalert isConfirm with angularjs
sweetalert isConfirm with angularjs
我有一个示例 code here,我想在其中使用 isConfirm
和 sweet alert as 继续或添加新值。
swal({
title: "Are you sure?",
text: "Save the name",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Save and Add Another",
cancelButtonText: "New",
closeOnConfirm: true,
closeOnCancel: true
}, function(isConfirm) {
if (isConfirm) {
// saves the input values & selected values using ajax call
$scope.test = '';
} else {
// reset input values & selected values and fresh input again
$scope.test = '';
$scope.mysel = '-1';
}
});
但是在点击保存并添加另一个按钮后,模型值并没有在第一次清除。此外,它不会在单击 New
时重置。代码有什么问题?
我有一个示例 code here,我想在其中使用 isConfirm
和 sweet alert as 继续或添加新值。
swal({
title: "Are you sure?",
text: "Save the name",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Save and Add Another",
cancelButtonText: "New",
closeOnConfirm: true,
closeOnCancel: true
}, function(isConfirm) {
if (isConfirm) {
// saves the input values & selected values using ajax call
$scope.test = '';
} else {
// reset input values & selected values and fresh input again
$scope.test = '';
$scope.mysel = '-1';
}
});
但是在点击保存并添加另一个按钮后,模型值并没有在第一次清除。此外,它不会在单击 New
时重置。代码有什么问题?