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


TypeScript modals.service.ModalsService類代碼示例

本文整理匯總了TypeScript中app/modals/modals.service.ModalsService的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.ModalsService類的具體用法?TypeScript service.ModalsService怎麽用?TypeScript service.ModalsService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1:

 }).then((httpCode: number) => {
   if (httpCode === 200) {
     localStorage.setItem('server_url', this.settingsForm.value.server_url);
     this._modalsService.openModal('modal-update-server-url-ok');
   } else {
     this._modalsService.openModal('modal-update-server-url-nok');
   }
 }).catch((error) => {
開發者ID:Rachoor,項目名稱:pia,代碼行數:8,代碼來源:settings.component.ts

示例2:

 this._globalEvaluationService.prepareForEvaluation().then(() => {
   let isPiaFullyEdited = true;
   for (const el in this._sidStatusService.itemStatus) {
     if (this._sidStatusService.itemStatus.hasOwnProperty(el) && this._sidStatusService.itemStatus[el] < 4 && el !== '4.3') {
       isPiaFullyEdited = false;
     }
   }
   if (isPiaFullyEdited) {
     this.goToNextSectionItem(4, 5);
     this._modalsService.openModal('completed-edition');
   } else {
     this.goToNextSectionItem(0, 4);
     this._modalsService.openModal('ask-for-evaluation');
   }
 });
開發者ID:Rachoor,項目名稱:pia,代碼行數:15,代碼來源:entry-content.component.ts

示例3: newCommentClickBtn

  /**
   * Create a new comment.
   * @memberof CommentsComponent
   */
  newCommentClickBtn() {
    // Checks if the comment value exists.
    if (this.commentsForm.value.description && this.commentsForm.value.description.length > 0) {
      // Checks if there are already comments and if so, checks if the last comment value is different from our current comment.

      // add Btn status
      if (this.comments.length > 0 && this.comments[0].description === this.commentsForm.value.description) {
        this._modalsService.openModal('modal-same-comment');
      } else {
        // Creates the new comment and pushes it as the first comment in list.
        // Updates accordeon and counter + removes the written comment.
        const commentRecord = new Comment();
        commentRecord.for_measure = false;
        commentRecord.description = this.commentsForm.value.description;
        commentRecord.pia_id = this.pia.id;
        if (this.measure) {
          commentRecord.for_measure = true;
          commentRecord.reference_to = this.measure.id;
        } else {
          commentRecord.reference_to = this.question.id;
        }
        commentRecord.create().then((id: number) => {
          commentRecord.id = id;
          this.comments.unshift(commentRecord);
          this.commentsForm.controls['description'].setValue('');
          this.getCommentsAccordeonStatus();
          this.newCommentDisplayer = false;
        });
      }
    }
  }
開發者ID:Rachoor,項目名稱:pia,代碼行數:35,代碼來源:comments.component.ts

示例4: if

 this._globalEvaluationService.validateAllEvaluation().then((toFix: boolean) => {
   this.goToNextSectionItem(5, 7);
   let isPiaFullyEvaluated = true;
   for (const el in this._sidStatusService.itemStatus) {
     if (this._sidStatusService.itemStatus.hasOwnProperty(el) && this._sidStatusService.itemStatus[el] !== 7 && el !== '4.3') {
       isPiaFullyEvaluated = false;
     }
   }
   if (isPiaFullyEvaluated) {
     this._modalsService.openModal('completed-evaluation');
   } else if (toFix) {
     this._modalsService.openModal('validate-evaluation-to-correct');
   } else {
     this._modalsService.openModal('validate-evaluation');
   }
 });
開發者ID:Rachoor,項目名稱:pia,代碼行數:16,代碼來源:entry-content.component.ts

示例5: onSubmit

 /**
  * Record the URL of the server.
  * @memberof SettingsComponent
  */
 onSubmit() {
     /* Set it back to empty if server mode is disabled */
     if (this.settingsForm.controls['server_url'].value === null || this.settingsForm.controls['server_url'].value.length <= 0) {
       localStorage.removeItem('server_url');
       this._modalsService.openModal('modal-update-server-url-ok');
     } else {
       fetch(this.settingsForm.value.server_url).then((response) => {
         return response.status;
       }).then((httpCode: number) => {
         if (httpCode === 200) {
           localStorage.setItem('server_url', this.settingsForm.value.server_url);
           this._modalsService.openModal('modal-update-server-url-ok');
         } else {
           this._modalsService.openModal('modal-update-server-url-nok');
         }
       }).catch((error) => {
         console.error('Request failed', error);
         this._modalsService.openModal('modal-update-server-url-nok');
       });
     }
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:25,代碼來源:settings.component.ts

示例6:

 this._piaService.pia.update().then(() => {
   this._modalsService.openModal('modal-simple-pia-validation');
 });
開發者ID:Rachoor,項目名稱:pia,代碼行數:3,代碼來源:validate-pia.component.ts

示例7: removeAttachment

 /**
  * Destroy an attachment
  * @param {number} id - Attachment id.
  * @memberof ValidatePIAComponent
  */
 removeAttachment(id: number) {
   localStorage.setItem('attachment-id', id.toString());
   this._modalsService.openModal('modal-remove-attachment');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:9,代碼來源:validate-pia.component.ts

示例8:

 this._sidStatusService.refusePia(this._piaService).then(() => {
   this.router.navigate(['entry', this._piaService.pia.id, 'section', 1, 'item', 1]);
   this._modalsService.openModal('modal-refuse-pia');
 });
開發者ID:Rachoor,項目名稱:pia,代碼行數:4,代碼來源:refuse-pia.component.ts

示例9: abandon

 /**
  * Display the modal to abandon the PIA.
  * @memberof RefusePIAComponent
  */
 abandon() {
   this._modalsService.openModal('modal-abandon-pia');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:7,代碼來源:refuse-pia.component.ts

示例10: cancelValidateEvaluation

 /**
  * Allow an user to cancel the validation.
  * @memberof EntryContentComponent
  */
 cancelValidateEvaluation() {
   this._globalEvaluationService.cancelValidation();
   this._modalsService.openModal('back-to-evaluation');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:8,代碼來源:entry-content.component.ts

示例11: cancelAskForEvaluation

 /**
  * Allow an user to return in edit mode.
  * @memberof EntryContentComponent
  */
 cancelAskForEvaluation() {
   this._globalEvaluationService.cancelForEvaluation();
   this._modalsService.openModal('back-to-edition');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:8,代碼來源:entry-content.component.ts

示例12: removeAttachment

 /**
  * Deletes an attachment with a given id.
  * @param {string} id - Unique id of the attachment to be deleted.
  * @memberof AttachmentItemComponent
  */
 removeAttachment(id: string) {
   localStorage.setItem('attachment-id', id);
   this._modalsService.openModal('modal-remove-attachment');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:9,代碼來源:attachment-item.component.ts

示例13: removePia

 /**
  * Opens the modal to confirm deletion of a PIA
  * @param {string} id - The PIA id.
  * @memberof ListItemComponent
  */
 removePia(id: string) {
   localStorage.setItem('pia-id', id);
   this._modalsService.openModal('modal-remove-pia');
 }
開發者ID:Rachoor,項目名稱:pia,代碼行數:9,代碼來源:list-item.component.ts


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