Hi guys, I’ve trying assossiate 2 objects in Firebase in the Ionic, first I call one method in service and after I call second method in another service, look this error
constructor(
private chatService: ChatProvider,
private userService: UserProvider) {
}
getUsers() {
this.userService.getUsers('citizens')
.subscribe((res) => {
this.citizens = res;
this.final_data = this.citizens.map(function(citizen) {
return this.chatService.getMessage(citizen.key);
})
console.log(this.final_data)
})
}
error: core.js:1448 ERROR TypeError: Cannot read property ‘chatService’ of undefined
Someone ?