以角度 4 编辑 [英] Edit in angular 4

查看:31
本文介绍了以角度 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.

有什么帮助吗?

推荐答案

我们要传key,编辑的数据和编辑的函数应该是这样的

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天全站免登陆