当前位置: 首页>>代码示例>>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;未经允许,请勿转载。