I started doing web-app development with angularJS which comes with a promise library but now I have to work on another project without one. How would I do this without having to import a promise library.
I've removed some of the irrelevant things but basically I need to get a file url from the backend, create an element based on this url, and then return the element. The thing is once I go inside the async function, I don't know how to get back out to return the created element.
var userLogoAWS = null;
$.get("http://localhost:8080/apps/admin/file",
{
category: category,
filename: "logo.png"
},
function(data){
userLogoAWS = data;
});
img.src = userLogoAWS;
//---- Create and Combine elements ----
var element = anchor.appendChild(img);
return element;