问题
I am working on Angular 4 project. Here I want to update the form data using firebase key
I have pass the data through component.ts as follow
this.service.editEnquiry(this.data);
I called editEnquiry()
of service. the editEnquiry()
is given as follows
editEnquiry(data)
{
console.log(data);
console.log(data.key);
this.af.list(`/enquirydata/`+key).update(data);
}
I am getting the data in editEnquiry()
but its not updating the record in firebase.
Its giving me error like this
Supplied parameters do not match any signature of call target.
any help?
回答1:
If you updating the data then you need to use -
AngularFireDatabase.object
please try below solution hope it helps -
editEnquiry(data)
{
console.log(data);
console.log(data.key);
this.af.object(`/enquirydata/`+key).update(data);
}
回答2:
we have to pass the key and the edited data and the edited function should be like this
editEnquiry(key,value)
{
console.log(key);
console.log(value);
this.af.object(`/enquirydata/`+ key).update(value);
}
It worked for me
来源:https://stackoverflow.com/questions/48942577/edit-in-angular-4