I am pulling some message data from database and iterating through it with this code:
this.msgData =this.db.list(`/messages/`).valueChanges();
this.msgData.subscribe(msg =>{
let data = msg.map(this.getObjectWithoutKnowingKey)
for(var i=0;i<data.length;i++){
for(var k=0;k<data[i].length;k++){
console.log(JSON.stringify(data[i][k].message));
}
}
What im trying to do is display those messages in html file like a feed.
Should i do this iteration in html file using ng-for ??
or should i decleare a array and push data into it then somehow iterate array in html using ngfor and display ? does angular recognize array from typescript because i know it recognizes objects from ts file
thanks