本文整理匯總了TypeScript中@services/dot-messages-service.DotMessageService.getMessages方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DotMessageService.getMessages方法的具體用法?TypeScript DotMessageService.getMessages怎麽用?TypeScript DotMessageService.getMessages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@services/dot-messages-service.DotMessageService
的用法示例。
在下文中一共展示了DotMessageService.getMessages方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: addContainerToolbar
/**
* Add custom HTML buttons to the containers div
*
* @param Document doc
* @memberof DotEditContentToolbarHtmlService
*/
addContainerToolbar(doc: Document): void {
this.dotMessageService
.getMessages([
'editpage.content.container.action.add',
'editpage.content.container.menu.content',
'editpage.content.container.menu.widget',
'editpage.content.container.menu.form',
'dot.common.license.enterprise.only.error'
])
.pipe(
switchMap(this.dotLicenseService.isEnterprise.bind(this.dotLicenseService)),
take(1)
)
.subscribe((isEnterpriseLicense: boolean) => {
const containers = Array.from(
doc.querySelectorAll('div[data-dot-object="container"]')
);
containers.forEach((container: HTMLElement) => {
const containerToolbar = document.createElement('div');
containerToolbar.classList.add('dotedit-container__toolbar');
if (!container.dataset.dotCanAdd.length) {
container.classList.add('disabled');
}
containerToolbar.innerHTML = this.getContainerToolbarHtml(
container,
isEnterpriseLicense
);
container.parentNode.insertBefore(containerToolbar, container);
});
});
}
示例2: ngOnInit
ngOnInit() {
this.dotMessageService
.getMessages([
'editpage.toolbar.page.cant.edit',
'editpage.toolbar.page.locked.by.user'
])
.subscribe();
}
示例3: constructor
constructor(
private dotMenuService: DotMenuService,
private ngZone: NgZone,
private dotGlobalMessageService: DotGlobalMessageService,
private dotMessageService: DotMessageService,
private dotPageStateService: DotPageStateService
) {
dotMessageService
.getMessages(['dot.common.message.saved', 'dot.common.message.saving'])
.subscribe();
}
示例4: ngAfterViewInit
ngAfterViewInit(): void {
this.dotMessageService
.getMessages(['workflow.task.dialog.header'])
.pipe(take(1))
.subscribe(() => {
this.dotWorkflowTaskDetailService.view({
header: this.dotMessageService.get('workflow.task.dialog.header'),
id: this.route.snapshot.params.asset
});
});
}
示例5: constructor
constructor(
public dotMessageService: DotMessageService,
private dotEventsService: DotEventsService
) {
this.dotMessageService
.getMessages([
'dot.common.message.loading',
'dot.common.message.loaded',
'dot.common.message.error'
])
.subscribe();
}
示例6: addContentletMarkup
/**
* Edit contentlet html to add button and content
*
* @param Document doc
* @memberof DotEditContentToolbarHtmlService
*/
addContentletMarkup(doc: Document): void {
this.dotMessageService
.getMessages([
'editpage.content.container.action.edit.vtl',
'editpage.content.contentlet.menu.drag',
'editpage.content.contentlet.menu.edit',
'editpage.content.contentlet.menu.remove'
])
.subscribe(() => {
const contentletQuery = `div[data-dot-object="contentlet"][data-dot-has-page-lang-version="true"]`;
const contentlets: HTMLDivElement[] = Array.from(
doc.querySelectorAll(contentletQuery)
);
contentlets.forEach((contentlet: HTMLDivElement) => {
this.addToolbarToContentlet(contentlet);
});
});
}
示例7: loadNavItems
private loadNavItems(): Observable<DotEditPageNavItem[]> {
return this.dotMessageService
.getMessages([
'editpage.toolbar.nav.content',
'editpage.toolbar.nav.properties',
'editpage.toolbar.nav.layout',
'editpage.toolbar.nav.code',
'editpage.toolbar.nav.license.enterprise.only',
'editpage.toolbar.nav.layout.advance.disabled'
])
.pipe(
mergeMap(() => {
return this.dotLicenseService.isEnterprise();
}),
map((isEnterpriseLicense: boolean) => {
this.isEnterpriseLicense = isEnterpriseLicense;
return this.getNavItems(this.pageState, isEnterpriseLicense);
})
);
}
示例8: ngOnInit
ngOnInit() {
const keys = [
'template.action.additional.permissions',
'template.action.additional.history',
'template.action.additional.properties'
];
this.dotMessageService.getMessages(keys).subscribe((messages) => {
this.items = [
{
label: messages['template.action.additional.properties'],
routerLink: `template/${this.inode}/properties`
},
{
label: messages['template.action.additional.permissions'],
routerLink: `template/${this.inode}/permissions`
},
{
label: messages['template.action.additional.history'],
routerLink: `template/${this.inode}/history`
}
];
});
}
示例9: ngOnInit
ngOnInit() {
this.messages$ = this.dotMessageService.getMessages([
'editpage.layout.designer.header',
'editpage.layout.designer.footer'
]).pipe(take(1));
}