以角度2映射表单值以获取特定对象

时间:2017-01-25 06:19:39

标签: json forms angular object angular2-formbuilder

当我提交表单并将其变成字符串时,我正在返回一个对象,因为我的服务需要一个字符串值。

然而......当我调用该函数时,它返回我的表单对象并将其放入'值'对象和我不确定如何只调用'值对象中的对象。有人可以帮忙吗?

我的onsubmit功能:

<form [formGroup]="eventForm" class="form-horizontal style-form" name="form" (ngSubmit)="submitEvent(eventForm.value)" novalidate>

我的表格:

{
  "value": {
    "name": "",
    "description": "",
    "attendeeCountMax": "",
    "attendeeCountMin": "",
    "costMax": "",
    "responseDeadline": "",
    "eventDates": {
      "startDate": "",
      "endDate": "",
      "type": 1
    },
    "location": {
      "cost": 0,
      "costDescription": "string",
      "costType": "string",
      "description": "string",
      "name": "string",
      "uri": "string"
    },
    "startDate": "2016-11-11T16:11:11.773Z"
  }
}

它返回的内容:

#import <FirebaseDatabaseUI/FirebaseTableViewDataSource.h>

我只想知道&#34;价值&#34;对象

0 个答案:

没有答案