I would like to set up a factory that does async work to return a service, and then provide that factory to a factory provider to provide that service to a component when it loa
you can make your promise function to be async
export function testFactory(auth: any, temp: any) { return new Promise(async(res, rej) => { const inst = new TestService(); await inst.ngOnInit(); res(inst); }); } export let testProvider = { provide: TestService, useFactory: testFactory, deps: [] };