Hakan Axheim

Hakan Axheim

  • 1.9k
  • 194
  • 21.7k

How to execute methods in a sequence in Angular

Nov 22 2017 9:49 AM
Hi, I'm stuck with a problem. I wan't to do this:
Load a dashboard witch consists of several widgets.
One widget is called Bookings and lists all bookings for a certain person.
This functionality is OK!
I want to push on a button New booking witch calls another application also made i Angular.
Now I want that my code shall wait until the app new booking is finished.
After that I want to update the widget with bookings on the dashboard with new bookings.
All functionality listed above is in a method which is called from the HTML page where the widget is.
My code in the method that is fired by the HMTL page looks like this:
callBookingCreate();
callUpdateDashboard();
When I push on the button New bookings both methods are executed at once before I am finished with the new bookings app.
I wan't to call the bookings app (first call) and wait for the new bookings app is finished and the execute the next line of code which are callUpdateDashboard().
How can I do that?

Answers (1)