本文整理匯總了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')));
}