docs(dialogs): confirm() can return a promise that resolves to 0 (#1617)

Document the fact that confirm() will return a promise that resolves to 0 if the user clicks outside the dialog box. This behavior was previously undocummented and could lead to issues if not handled properly.
This commit is contained in:
Nico 2017-05-28 20:59:51 +02:00 committed by Ibby Hadeed
parent d9d7919174
commit b587a0e647

View File

@ -69,7 +69,7 @@ export class Dialogs extends IonicNativePlugin {
* @param {string} message Dialog message.
* @param {string} title Dialog title. (Optional, defaults to Confirm)
* @param {Array<string>} buttonLabels Array of strings specifying button labels. (Optional, defaults to [OK,Cancel])
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked. Note that the index use one-based indexing.
* @returns {Promise<number>} Returns a promise that resolves the button index that was clicked, or 0 if the user has dismissed the dialog by clicking outside the dialog box. Note that the index use one-based indexing.
*/
@Cordova({
successIndex: 1,