角度表单值将父表单设置为子表单数组页面

时间:2018-11-12 06:21:01

标签: angular angular-reactive-forms

Parent HTML


<div formArrayName="pDFormArray">
          <div *ngFor="let pDForm of pDFormArray.controls; let j=index" [formGroupName]="j">
            <p-accordion #pAccordion class="pc-f-accordion">
              <p-accordionTab selected="true">

                <app-p-rotation [PRList]="PRList" #pDirection></app-p-rotation>

                <!-- </div> -->
              </p-accordionTab>
            </p-accordion>
          </div>

父组件具有此pList列表值。需要将此值设置为子组件数组

[  

{
      “ dirC”:“ aa”,       “ pList”:[
         {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:1,             “ portStayHrQ”:1,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:1,             “ terminalMu”:“ T1”,             “ sailingDayQ”:1,          },          {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:2,             “ portStayHrQ”:2,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:2,             “ terminalMu”:“ T1”,             “ sailingDayQ”:2,          },          {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:3,             “ portStayHrQ”:3,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:3,             “ terminalMu”:“ T1”,             “ sailingDayQ”:3,          }       ]    },    {
      “ dirC”:“ bbb”,       “ pList”:[
         {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:1,             “ portStayHrQ”:1,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:1,             “ terminalMu”:“ T1”,             “ sailingDayQ”:1,          },          {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:2,             “ portStayHrQ”:2,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:2,             “ terminalMu”:“ T1”,             “ sailingDayQ”:2,             “ seqN”:2,             “ portC”:“ bb2”          }       ]    },    {
      “ dirC”:“ ccc”,       “ pList”:[
         {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:1,             “ portStayHrQ”:1,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:1,             “ terminalMu”:“ T1”,             “ sailingDayQ”:1,          },          {
            “ createdDt”:“ 2018-11-09T13:39:04”,             “ portStayDayQ”:2,             “ portStayHrQ”:2,             “ modifiedDt”:“ 2018-11-09T13:39:05”,             “ sailingHrQ”:2,             “ terminalMu”:“ T1”,             “ sailingDayQ”:2,          }       ]    } ]

0 个答案:

没有答案