I (currently) know very little about AngularJS which is making this task all the more interesting!
I am creating a Dashboard to show data stored in a custom database table. There is also the ability to request an update of the content in the table.
I initially wrote the API Controller to use async methods but I seemed to have trouble calling them from AngularJS so I have removed the async feature for now, but would like to add it back in.
Do I need to use AngularJS "promise" in order to call async APIs? If so, could someone explain how I do that please.
What do I need to change in order to support calling an async version of "GetReviewsData"?
**Edit: I have reverted my code to use async calls and it seems to be working, (although I do have an issue when calling the update the second time!) so do I need to change anything or is the above code OK?
Calling an async API from AngularJS
I (currently) know very little about AngularJS which is making this task all the more interesting!
I am creating a Dashboard to show data stored in a custom database table. There is also the ability to request an update of the content in the table.
I initially wrote the API Controller to use async methods but I seemed to have trouble calling them from AngularJS so I have removed the async feature for now, but would like to add it back in.
Do I need to use AngularJS "promise" in order to call async APIs? If so, could someone explain how I do that please.
I currently have this:
What do I need to change in order to support calling an async version of "GetReviewsData"?
**Edit: I have reverted my code to use async calls and it seems to be working, (although I do have an issue when calling the update the second time!) so do I need to change anything or is the above code OK?
I use the umbRequestHelper like below
Could you also show me how you call the function please, and how you then make use of the data returned.
When I tried, none of the $scope variables I set seemed to have any values in them - but they did before using the factory method above.
Hi Gordon,
This is the code for my angular controller
The preview is called here
It is displayed in the html by binding 'markup'
Thanks very much for your help, I will check this out tomorrow :-)
is working on a reply...