Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

358
Vistas
Angular Universal Render to Wait for Http Result Observable Subscriber

I have an Angular Universal app that calls an ASP.Net Web API service.

I have put Console writes on the Angular call to the web service (which was initiated from either a component's constructor or ngOnInit, I tried both) and the subscriber function in Typescript, as well as on the Web API method.

When running the app, I notice that the Angular Universal app does not wait for the Web API's result.

The last console write message that I get is from the Web API, not from the function in the subscriber call.

How can I force the Angular Universal app to wait for the result before finishing the render?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As long as you are using the Angular HttpClient, the server-side-render should wait for it to finish before serving your response.

If this doesn't work for you, try subscribing to the call using the | async pipe in your template code.

For example:

export class MyComponent {
  public response$ = this.httpClient.get<string>('https://my.api');

  constructor(private httpClient: HttpClient){}
}
<span> {{ response$ | async }} </span>
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda