METHOD 1
{
var myform = getForm();
var myVar = $sce.trustAsHtml(myForm);
}
METHOD 2
var getForm = function () {
var form = "";
//API CALL here using custom service
.then(
function (response) {
form = //processing here
},
function (response) {
}
return form;
};
In below scenario I am calling getForm()
method and need processed data from form variable. But it always return empty before processing.
How can I make this call sync so that I can getForm()
return the processed data and returns to method 1