本文整理汇总了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) => {
示例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');
}
});
示例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;
});
}
}
}
示例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');
}
});
示例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');
});
}
}
示例6:
this._piaService.pia.update().then(() => {
this._modalsService.openModal('modal-simple-pia-validation');
});
示例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');
}
示例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');
});
示例9: abandon
/**
* Display the modal to abandon the PIA.
* @memberof RefusePIAComponent
*/
abandon() {
this._modalsService.openModal('modal-abandon-pia');
}
示例10: cancelValidateEvaluation
/**
* Allow an user to cancel the validation.
* @memberof EntryContentComponent
*/
cancelValidateEvaluation() {
this._globalEvaluationService.cancelValidation();
this._modalsService.openModal('back-to-evaluation');
}
示例11: cancelAskForEvaluation
/**
* Allow an user to return in edit mode.
* @memberof EntryContentComponent
*/
cancelAskForEvaluation() {
this._globalEvaluationService.cancelForEvaluation();
this._modalsService.openModal('back-to-edition');
}
示例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');
}
示例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');
}