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 { return (): Promise => { return new Promise((resolve,reject) => { appConfig.load().then(() => { itemtypeService.load(appConfig); }).then(() => resolve()).catch(() => reject()); }); } }