Hello!
I’m new to NativeScript and Im trying to use NativeScript (with Angular2) together with Firebase using nativescript-plugin-firebase. When using “addChildEventListener” to listen for data changes from Firebase I must manually trigger change detection in the callback function to make the UI re-render. Anyone know a way around this problem?
ngOnInit() {
this.isLoading = true;
firebase.addValueEventListener(snapshot => {
this.isLoading = false;
this.todos = snapshot.value;
this.cdr.detectChanges(); // Can I avoid this somehow?
}, '/lists')
.then(listenerWrapper => {
this.listeners = listenerWrapper.listeners;
}
);
}