本文整理汇总了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));
}