本文整理汇总了TypeScript中@eg/share/string/string.service.StringService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.StringService类的具体用法?TypeScript service.StringService怎么用?TypeScript service.StringService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.StringService类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ngOnInit
ngOnInit() {
// No key means it's an unregistered (likely static) string
// that does not need interpolation.
if (this.key) {
this.strings.register({
key: this.key,
resolver: (ctx: any) => {
if (this.text) {
// When passed text that does not require any
// interpolation, just return it as-is.
return Promise.resolve(this.text);
} else {
// Interpolate
return this.current(ctx);
}
}
});
}
}
示例2: getPointLabel
getPointLabel(point: IdlObject, showmatch?: boolean): Promise<string> {
return this.strings.interpolate(
'staff.cat.vandelay.matchpoint.label',
{point: point, showmatch: showmatch}
);
}