메시지와 단추가 포함된 경고 대화 상자를 표시합니다.
사용할 수 있는 대상
모델 기반 앱
Syntax
context.navigation.openAlertDialog(alertStrings, options)
매개 변수
| 매개 변수 이름 | 유형 | 필수 | Description |
|---|---|---|---|
| alertStrings | AlertDialogStrings |
Yes | 경고 대화 상자에 사용할 문자열입니다. AlertDialogStrings에는 다음과 같은 특성이 있습니다. - text: string. 경고 대화 상자에 표시할 메시지입니다. - confirmButtonLabel: string. 확인 단추 레이블입니다. 단추 레이블을 지정하지 않으면 확인 (사용자의 기본 설정 언어)이 단추 레이블로 사용됩니다. |
| options | AlertDialogOptions |
Yes | 대화 상자 옵션입니다. AlertDialogOptions에는 다음과 같은 특성이 있습니다. - height: number. 경고 대화 상자의 높이(픽셀)입니다. - width: number. 경고 대화 상자의 너비(픽셀) |
반환 값
형식: Promise
비고
Example
context.navigation.openAlertDialog({text:"This is an alert.", confirmButtonLabel : "Yes",}).then(
function success()
{
document.getElementById("openAlertDialogButton")!.innerHTML = "Alert dialog closed";
},
function()
{
document.getElementById("openAlertDialogButton")!.innerHTML = "Error in Alert Dialog";
}
);