當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。