Angular Async Factory Provider
问题 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 loads. However, when the provider injects the TestService into the TestComponent , the type at runtime is ZoneAwarePromise . I need a way to have the provider automatically "await" the promise before it injects the service into the component. Service export class TestService { public test() { return 123; } } Provider and