Currently, I am utilizing Angular 6 along with smart table by visiting this link: .
Everything was functioning smoothly, until the moment I attempted to switch from static to dynamic data:
The following code works perfectly and displays all the content within the table :
source: LocalDataSource = new LocalDataSource();
data = [{
id: 1,
Customer: 'UK LTD',
Name: 'Mark Poll',
Code: '84615A',
PostalCode: 'U48K46',
Date: '09/19/2018',
},
];
this.source.load(this.data);
However, when trying the next piece of code, it doesn't work as expected :
data1 = [];
source: LocalDataSource = new LocalDataSource();
getArray() {
this.afDatabase.list('/imones').valueChanges().subscribe(res => {
this.data1 = res;
console.log(this.data1)
})
}
this.source.load(this.data1);
Despite both codes appearing similar in output results : https://i.stack.imgur.com/oHrgr.png
If anyone has encountered this issue before, could you please shed some light on what might be going wrong?