I have function in angularJS invoked when clicked, I am also calling another service function inside that function, which is going to change some values for later use in first function.
Problem statement: Function getData finishes first with retrning model, and after it finishes it all process then calll getDetails. I want to make this call in sequence.
this.getData = function () {
var a = '';
var b = '';
var c = '';
//I want this call to be finished before above function
MyServices.getDetails(id, type)
.success(function(data, status, headers, config){
if(status == '200'){
// my code goes here to change some values
})
}
var model = [];
retrun model
};