3
所以我有下面的代码获取FirebaseObjectObservable。但路径是动态的,因为它可能还没有。所以如果路径不在那里,我想创建这条路径。但如果它在那里,我想更新/修补数据。我如何知道FirebaseObjectObservable为空?
this.userLocationDetail = this.af.database.object('/userProfile/' + uid + '/bbwList/' + afLocationId);
if (this.userLocationDetail) {
console.log('Data is found');
} else {
console.log('Data not found');
}
问题是如果(this.userLocationDetail)将始终为真。我怎样才能看到可观察的并确定它是空的?
谢谢!任何示例以及可观察的方法? –
我添加了一个可观察的代码 –