16 lines
520 B
TypeScript
16 lines
520 B
TypeScript
import { Injector } from '@angular/core';
|
|
import { AppConfig } from "./app.config";
|
|
import {ItemTypeService} from '../services/itemtype.service';
|
|
|
|
|
|
|
|
export function appConfigFactory(injector:Injector, appConfig: AppConfig, itemtypeService:ItemTypeService): () => Promise<any> {
|
|
return (): Promise<any> => {
|
|
return new Promise<void>((resolve,reject) => {
|
|
appConfig.load().then(() => {
|
|
itemtypeService.load(appConfig);
|
|
}).then(() => resolve()).catch(() => reject());
|
|
});
|
|
}
|
|
}
|