I'm trying to get the values of a map:
UtilisateursService.ts
getIntervenants():Map<string,string> {
let IdDisplayNameInt = new Map();
firebase.database().ref("/users").orderByKey().once("value")
.then(function(snapshot)
{
snapshot.forEach(function(childSnapshot)
{
IdDisplayNameInt.set(childSnapshot.val().UserId,childSnapshot.val().firstName + " " +childSnapshot.val().lastName);
}
)
});
return IdDisplayNameInt;
}
in new-cl-component.ts i have:
this.intervenantsList=this.userService.getIntervenants();
console.log("this.intervenantsList = ",this.intervenantsList);
console.log("this.intervenantsList.values = ",this.intervenantsList.values());
for (var valeur of intervenantsList.values()) {
console.log("valeur = ",valeur);
this.DisplayNameIntervenants.push(valeur) }
console.log("this.int = ",this.DisplayNameIntervenants) ;
The map intervenantsList contains all the data that i need,
but when i try to display intervenantsList.values(), it's empty:

i tried with a basic map, and it works
let map = new Map();
map.set("A",1);
map.set("B",2);
map.set("C",3);
console.log("map = ",map);
console.log("map.values= ",map.values());---- returns 1,2,3