Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!