am making one chat application in which … while adding member in group am getting this error
Error: Reference.child failed: First argument was an invalid path = “undefined”. Paths must be non-empty strings and can’t contain “.”, “#”, “$”, “[”, or “]”
at Object.exports.validatePathString (http://localhost:8100/build/vendor.js:39083:15)
at Reference.child (http://localhost:8100/build/vendor.js:63197:30)
at GroupsProvider.webpackJsonp.286.GroupsProvider.addmember (http://localhost:8100/build/main.js:493:103)
at GroupbuddiesPage.webpackJsonp.485.GroupbuddiesPage.addbuddy (http://localhost:8100/build/9.js:110:27)
at Object.eval [as handleEvent] (ng:///GroupbuddiesPageModule/GroupbuddiesPage.ngfactory.js:35:31)
at handleEvent (http://localhost:8100/build/vendor.js:13921:155)
at callWithDebugContext (http://localhost:8100/build/vendor.js:15430:42)
at Object.debugHandleEvent [as handleEvent] (http://localhost:8100/build/vendor.js:15017:12)
at dispatchEvent (http://localhost:8100/build/vendor.js:10336:25)
at http://localhost:8100/build/vendor.js:10961:38
please check my below code
getgroupimage() {
return new Promise((resolve, reject) => {
this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).once(‘value’, (snapshot) => {
this.grouppic = snapshot.val().groupimage;
resolve(true);
})
})
}
addmember(newmember) {
this.firegroup.child(firebase.auth().currentUser.uid).child(this.currentgroupname).child(‘members’).push(newmember).then(() => {
this.getgroupimage().then(() => {
this.firegroup.child(newmember.uid).child(this.currentgroupname).set({
groupimage: this.grouppic,
owner: firebase.auth().currentUser.uid,
msgboard: ‘’
}).catch((err) => {
console.log(err);
})
})
this.getintogroup(this.currentgroupname);
})
}
}
my addbuddy function
addbuddy(buddy) {
this.newbuddy = buddy;
this.groupservice.addmember(buddy);
}
my html code -
{{key.displayName}}
Addplease help me to fix this error