I need the value of that.assigned
outside the forEach but it would result with undefined
if I ever use it as console.log(that.assigned)
which is an array
assignedDoctors.then(function(doc){
let i = 0;
doc.forEach(function(md){
tmpMDs.push(md.data());
tmpMDs[i].key = md.id;
// tmpMDs.push(md.data().push());
i++;
});
that.assigned = tmpMDs;
}).catch(function(e){
console.log(e);
});
console.log(that.assigned)