本文整理匯總了TypeScript中@eg/core/locale.service.LocaleService.currentLocaleCode方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.LocaleService.currentLocaleCode方法的具體用法?TypeScript service.LocaleService.currentLocaleCode怎麽用?TypeScript service.LocaleService.currentLocaleCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@eg/core/locale.service.LocaleService
的用法示例。
在下文中一共展示了service.LocaleService.currentLocaleCode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: resolve
/**
* Loads pre-auth data common to all applications.
* No auth token is available at this level. When needed, auth is
* enforced by application/group-specific resolvers at lower levels.
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Promise<void> {
OpenSRF.locale = this.locale.currentLocaleCode();
this.idl.parseIdl();
return this.org.fetchOrgs(); // anonymous PCRUD.
}
示例2: ngOnInit
ngOnInit() {
// Default to the login locale
this.selectedLocale = this.locale.currentLocaleCode();
this.locales = [];
this.locale.supportedLocales().subscribe(l => this.locales.push(l));
this.onOpen$.subscribe(() => {
const elm = this.renderer.selectRootElement('#translation-input');
if (elm) {
elm.focus();
elm.select();
}
});
}
示例3:
l => l.code() === this.locale.currentLocaleCode())[0];