Restrict function based on API response

22 views
Skip to first unread message

Sivaprakash Gopal

unread,
Jun 29, 2019, 4:42:30 PM6/29/19
to Angular and AngularJS discussion
Hi All,

Drop down elements in our application populated based on API response. But drop down elements is rendered before API response itself. Is there any way to restrict rendering/certain functionality to be on hold until API response is completed.

Thanks,
Siva

Sander Elias

unread,
Jun 30, 2019, 1:04:27 AM6/30/19
to Angular and AngularJS discussion
Hi Siva,

You can render the options list when the results are in.

Regards
Sander

Sivaprakash Gopal

unread,
Jun 30, 2019, 1:29:37 AM6/30/19
to Angular and AngularJS discussion
Hi Sander,

Thanks for your solution.

But i want to stop rendering other (form controls) HTML elements too.

Thanks,
Siva

Sander Elias

unread,
Jun 30, 2019, 3:52:43 AM6/30/19
to Angular and AngularJS discussion
Then you should hold off rendering untill all data is there, or use the async pipe to make the parts that need dynamic data to update theirselves
Reply all
Reply to author
Forward
0 new messages