當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript dialogs.alert函數代碼示例

本文整理匯總了TypeScript中tns-core-modules/ui/dialogs.alert函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript alert函數的具體用法?TypeScript alert怎麽用?TypeScript alert使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了alert函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: onDayViewEventSelected

 onDayViewEventSelected(args: CalendarDayViewEventSelectedData) {
     var event: CalendarEvent = args.eventData;
     alert(
         {
             title: "Event Selected",
             message: event.title,
             okButtonText: "OK"
         });
 }
開發者ID:haylahi,項目名稱:mobile-app,代碼行數:9,代碼來源:calendar-day-view.component.ts

示例2: alert

      model.onNotificationActionTakenCallback = (actionIdentifier: string, message: firebase.Message, inputText?: string) => {
        console.log(`onNotificationActionTakenCallback fired! \n\r Message: ${JSON.stringify(message)}, \n\r Action taken: ${actionIdentifier}`);

        alert({
          title: "Interactive push action",
          message: `Message: ${JSON.stringify(message)}, \n\r Action taken: ${actionIdentifier}` + (inputText ? `, \n\r Input text: ${inputText}` : ""),
          okButtonText: "Nice!"
        });
      };
開發者ID:NathanWalker,項目名稱:nativescript-plugin-firebase,代碼行數:9,代碼來源:messaging-view-model.ts

示例3: alertName

 public alertName(args: observable.EventData) {
     dialogs.alert({
         title: "Name",
         message: "The name will change.",
         okButtonText: "OK"
     }).then((alertResult) => {
         console.log("### Result: " + alertResult);
         this.set("name", "John Reese");
     });
 }
開發者ID:qbert,項目名稱:NativeScript,代碼行數:10,代碼來源:view-model.ts

示例4: onTap

    public onTap() {
        this.myCommitDataFormComp.dataForm.commitAll();

        alert(
            {
                title: "Registration Details",
                message: this.myCommitDataFormComp.dataForm.source.toString(),
                okButtonText: "OK"
            });
    }
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:10,代碼來源:dataform-scrolling.component.ts

示例5: onTap

export function onTap() {
     var options = {
            title: "Race selection",
            message: "Race chosen: Unicorn",
            okButtonText: "OK"
        };
        alert(options).then(() => {
            console.log("Race chosen!");
        });
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:10,代碼來源:issue-3211.ts

示例6: test_DummyTestForSnippetOnly2

export function test_DummyTestForSnippetOnly2() {
    // >> dialog-alert
    var options = {
        title: "Race Selection",
        message: "Race Chosen: Elf",
        okButtonText: "OK"
    };
    dialogs.alert(options).then(() => {
        console.log("Race Chosen!");
    });
    // << dialog-alert
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:12,代碼來源:dialog-tests.ts

示例7: onTap

// >> angular-dataform-custom-validation
    public onTap() {
        let isValid = true;

        const p1 = this.myCustomDataFormComp.dataForm.getPropertyByName("username");
        const p2 = this.myCustomDataFormComp.dataForm.getPropertyByName("password");

        if (p1.valueCandidate.toLowerCase() !== "admin1") {
            p1.errorMessage = "Use admin1 as username.";
            this.myCustomDataFormComp.dataForm.notifyValidated("username", false);
            isValid = false;
        } else {
            this.myCustomDataFormComp.dataForm.notifyValidated("username", true);
        }

        if (p2.valueCandidate.toLowerCase() !== "pass1") {
            p2.errorMessage = "Use pass1 as password.";
            this.myCustomDataFormComp.dataForm.notifyValidated("password", false);
            isValid = false;
        } else {
            this.myCustomDataFormComp.dataForm.notifyValidated("password", true);
        }

        this._text = null;

        if (!isValid) {
            this._text = "Username and Password are not recognized.";
        } else {
            this._text = "";
            this.myCustomDataFormComp.dataForm.commitAll();

            alert(
                {
                    title: "Successful Login",
                    message: "Welcome, " + this.myCustomDataFormComp.dataForm.source.username,
                    okButtonText: "OK"
                });

        }
    }
開發者ID:telerik,項目名稱:nativescript-ui-samples-angular,代碼行數:40,代碼來源:dataform-custom-validation.component.ts

示例8: setTimeout

 setTimeout(() => {
   dialogs.alert(`${msg} For real. It's really working :)`).then(() => console.log(`Dialog closed.`));
 }, 2000);
開發者ID:wwwalkerrun,項目名稱:nativescript-plugin-seed,代碼行數:3,代碼來源:yourplugin.common.ts

示例9: alert

 }, (err) => {
   alert(err);
 });
開發者ID:EddyVerbruggen,項目名稱:nativescript-barcodescanner,代碼行數:3,代碼來源:main-view-model.ts


注:本文中的tns-core-modules/ui/dialogs.alert函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。