My lists are only populated when I manually enter in static values for the variables, not when I get them from the forEach loop.
TypeScript
this.pinnedCCollection = this.afs.collection(pinnedCollection);
this.pinnedC = this.pinnedCCollection.valueChanges().do(item => {
console.log('-------------');
item.forEach(element => {
// NOT WORKING
// this.searchedS = element.s;
// this.selectedT = element.t;
// this.selectedC = element.c;
// WORKING
this.searchedS = 'static value 1';
this.selectedT = 'static value 2';
this.selectedC = 'static value 3';
this.searchForA();
});
});
searchForA(){
var placeToSearch = 'SPlace/'+this.searchedS+'/TPlace/'+this.selectedT+'/CPlase/'+this.selectedC+'/APlace';
this.aCollection = this.afs.collection(placeToSearch);
this.a = this.aCollection.valueChanges();
}
typeof item ? can you add a sample data ?itemorelementhave types. Do I need it?forEach, and I'm able to successfully log out the value of those elements inside of forEach and they are successfully saved into my local variables. ThensearchForA()runs with the proper values in place, but the list on my webpage still comes up empty. The values from the properties ofelementseem to be perfectly fine.