在角度4中编辑 [英] Edit in angular 4

查看:60
本文介绍了在角度4中编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事Angular 4项目. 在这里,我要使用Firebase键

I am working on Angular 4 project. Here I want to update the form data using firebase key

我已经按照如下方式通过component.ts传递了数据

I have pass the data through component.ts as follow

    this.service.editEnquiry(this.data);

我称服务为editEnquiry(). editEnquiry()给出如下

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);
}

我在editEnquiry()中获取数据,但是它没有更新firebase中的记录. 它给我这样的错误

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.

有什么帮助吗?

推荐答案

我们必须传递密钥,并且编辑后的数据和编辑后的函数应该像这样

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);
}

对我有用

这篇关于在角度4中编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆