Am working on a chat application using NativeScript with Angular using a Firebase plugin. Am using the firebase event listener to listen for changes on a path like this:
firebase.addValueEventListener( (result) => {
for(var key in result.value){
this.posts.push(result.value[key].Message);
}
this.messages = this.posts;
//am using this.messges to update the view
this.posts=[];
}, '/forum/messages');
}
The problem is when I send a message from my end the view gets updated but when someone sends a message from their end the messages array changes but I don't see it unless I restart the application. What could be causing this.
NgZone.isInAngularZone()if put it front ofthis.message?