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

191
Views
how to load the data before the component is rendered in the Angular

The page movement does not occur, so you do not use the router. However, when you click on a particular element, a new window created with the mat dialog of the Angular appears and shows the data. At this time, the data is received from the server. The current data load is slow, so the user can see the change from the initial value to the value from the server.

Is there a way to get the data before the component is rendered?

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Usually, one thing you can do is create the component but keep it hidden so that when it does get shown, the data is already loaded. That may be difficult with a MatDialog so you might want to pre-load the data in your main component and then pass the data into your MatDialog when it opens (see the data input for MatDialog https://material.angular.io/components/dialog/api#MatDialogConfig)

Example:

this.dialog.open(YourComponent, {
  data: {
    someText: "Hello world",
    someData: {id: 1}
  }
});
about 4 years ago · Juan Pablo Isaza Report

0

Just trying to help, I am not angular expert but looking into angular life cycles will be a great start for this problem this will not only help you with this problem but also will help you properly utilize angular.

about 4 years ago · Juan Pablo Isaza Report

0

In case, you use Observables for getting data from the server, you can not subscribe manually in the component on ngOnInit of the component, you can just async pipe for getting and displaying data in the template

about 4 years ago · Juan Pablo Isaza 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!