当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript utils.CoreUtilsProvider类代码示例

本文整理汇总了TypeScript中@providers/utils/utils.CoreUtilsProvider的典型用法代码示例。如果您正苦于以下问题:TypeScript CoreUtilsProvider类的具体用法?TypeScript CoreUtilsProvider怎么用?TypeScript CoreUtilsProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CoreUtilsProvider类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

    constructor(private translate: TranslateService, element: ElementRef, private eventsProvider: CoreEventsProvider,
            utils: CoreUtilsProvider) {
        this.element = element.nativeElement;

        // Calculate the unique ID.
        this.uniqueId = 'core-loading-content-' + utils.getUniqueId('CoreLoadingComponent');
    }
开发者ID:jleyva,项目名称:moodlemobile2,代码行数:7,代码来源:loading.ts

示例2: notificationClicked

        pushNotificationsDelegate.on('click').subscribe((notification) => {
            if (utils.isFalseOrZero(notification.notif)) {
                notificationClicked(notification);

                return true;
            }
        });
开发者ID:jleyva,项目名称:moodlemobile2,代码行数:7,代码来源:messages.module.ts

示例3:

        return this.coursesProvider.getCoursesByField('ids', courseIds).then((coursesInfo) => {
            coursesInfo = this.utils.arrayToObject(coursesInfo, 'id');

            courses.forEach((course) => {
                this.loadCourseExtraInfo(course, coursesInfo[course.id]);
            });
        });
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:7,代码来源:helper.ts

示例4:

        }).catch((error) => {
            if (this.utils.isWebServiceError(error)) {
                // The WebService returned an error, assume the preflight failed.
                this.accessRuleDelegate.notifyPreflightCheckFailed(rules, quiz, attempt, preflightData, prefetch, siteId);
            }

            return Promise.reject(error);
        });
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:8,代码来源:helper.ts

示例5: runTask

 /**
  * Open task.
  *
  * @param {any} task Task to be done.
  */
 runTask(task: any): void {
     if (task.code == 'submit') {
         // This will close the modal and go to the submit.
         this.viewCtrl.dismiss(true);
     } else if (task.link) {
         this.utils.openInBrowser(task.link);
     }
 }
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:13,代码来源:phase.ts

示例6: notificationClicked

        pushNotificationsDelegate.on('click').subscribe((notification) => {
            if (utils.isTrueOrOne(notification.notif)) {
                // Execute the callback in the Angular zone, so change detection doesn't stop working.
                zone.run(() => {
                    notificationClicked(notification);
                });

                return true;
            }
        });
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:10,代码来源:notifications.module.ts

示例7: realGradeValueHelper

    /**
     * Calculates the real value of a grade based on real_grade_value.
     *
     * @param  {number} value    Percentual value from 0 to 100.
     * @param  {number} max      The maximal grade.
     * @param  {number} decimals Decimals to show in the formatted grade.
     * @return {string}          Real grade formatted.
     */
    protected realGradeValueHelper(value: number, max: number, decimals: number): string {
        if (value == null) {
            return null;
        } else if (max == 0) {
            return '0';
        } else {
            value = this.textUtils.roundToDecimals(max * value / 100, decimals);

            return this.utils.formatFloat(value);
        }
    }
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:19,代码来源:helper.ts

示例8:

        return this.loginHelper.getSitePolicy(this.siteId).then((sitePolicy) => {
            this.sitePolicy = sitePolicy;

            // Try to get the mime type.
            return this.utils.getMimeTypeFromUrl(sitePolicy).then((mimeType) => {
                const extension = this.mimeUtils.getExtension(mimeType, sitePolicy);
                this.showInline = extension == 'html' || extension == 'htm';
            }).catch(() => {
                // Unable to get mime type, assume it's not supported.
                this.showInline = false;
            }).finally(() => {
                this.policyLoaded = true;
            });
        }).catch((error) => {
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:14,代码来源:site-policy.ts

示例9:

 return super.callWS().catch((error) => {
     if (typeof this.showError == 'undefined' || this.utils.isTrueOrOne(this.showError)) {
         this.domUtils.showErrorModalDefault(error, 'core.serverconnection', true);
     }
 }).finally(() => {
开发者ID:SATS-Seminary,项目名称:moodlemobile2,代码行数:5,代码来源:call-ws-click-directive.ts


注:本文中的@providers/utils/utils.CoreUtilsProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。