本文整理汇总了TypeScript中@ngx-config/core.ConfigService.getSettings方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ConfigService.getSettings方法的具体用法?TypeScript ConfigService.getSettings怎么用?TypeScript ConfigService.getSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ngx-config/core.ConfigService
的用法示例。
在下文中一共展示了ConfigService.getSettings方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Init
t.inject([LanguageEffects, ConfigService], (effects: LanguageEffects, config: ConfigService) => {
const defaultLanguage = config.getSettings('i18n.defaultLanguage');
const action = new Init(config.getSettings('i18n'));
const completion = new UseLanguageSuccess(defaultLanguage);
const actions$ = TestBed.get(Actions);
actions$.stream = hot('-a', {a: action});
const expected = cold('-c', {c: completion});
(t.e(effects.init$) as any).toBeObservable(expected);
}));
示例2: getWorkingLanguage
t.inject([ConfigService], (config: ConfigService) => {
const defaultLanguage = config.getSettings('i18n.defaultLanguage');
const res = getWorkingLanguage(defaultLanguage);
t.e(res)
.toBe(defaultLanguage);
}));
示例3: UseLanguageSuccess
t.inject([ConfigService], (config: ConfigService) => {
const defaultLanguage = config.getSettings('i18n.defaultLanguage');
const action = new UseLanguageSuccess(defaultLanguage);
const res = reducer(defaultLanguage, action);
t.e(res)
.toEqual(defaultLanguage);
}));
示例4:
t.inject([ConfigService, I18NService], (config: ConfigService, i18n: I18NService) => {
i18n.init(config.getSettings('i18n'));
t.e(i18n.availableLanguages.length)
.toBe(1);
t.e(i18n.availableLanguages[0].code)
.toBe('en');
}));
示例5: UseLanguage
.subscribe(() => {
const defaultLanguage = config.getSettings('i18n.defaultLanguage');
const action = new UseLanguage(defaultLanguage.code);
const completion = new UseLanguageSuccess(defaultLanguage);
const actions$ = TestBed.get(Actions);
actions$.stream = hot('-a', {a: action});
const expected = cold('-c', {c: completion});
(t.e(effects.useLanguage$) as any).toBeObservable(expected);
});
示例6: ngOnInit
ngOnInit(): void {
this.title = 'APP_NAME';
this.currentLanguage$ = this.store.pipe(select(getWorkingLanguage));
this.availableLanguages = this.config.getSettings('i18n.availableLanguages');
this.isAuthenticated = this.auth.isAuthenticated;
}
示例7: ngOnInit
ngOnInit(): void {
this.i18nStore.dispatch(new Init(this.config.getSettings('i18n')));
}