我将具有@Input指令具有数组的对象传递给具有多个matAutoCompletes的子组件,但是我无法读取undefined的属性值,不确定原因。
父亲组件html
<div *ngIf="modalActive">
<div class="modal-body">
<app-resumo-cliente [dadosResumo]="dadosResumo" [modeloItensContratados]="resgate" (myEvent)="openModal($event)"></app-resumo-cliente>
</div>
<div class="botoes-modal">
</div>
<div class="clear"></div>
</div>
html
<mat-form-field>
<input type="text" placeholder="Cep" aria-label="Number" matInput formControlName="cep" [matAutocomplete]="auto">
<mat-autocomplete #auto="matAutocomplete">
<mat-option *ngFor="let cep of dadosResumo.ceps" [value]="cep">
{{ cep }}
</mat-option>
</mat-autocomplete>
</mat-form-field>
dadosResumo对象
{enderecos: Array(1), telefones: Array(1), emails: Array(1), contasCompletas: Array(1), contas: Array(1), …}
agencias
:
[undefined]
bancos
:
["1"]
ceps
:
["20550140"]
contas
:
[Array(1)]
contasCompletas
:
["27278-727278-7"]
emails
:
[Array(1)]
emailsAuto
:
[undefined]
enderecos
:
[{…}]
logradouros
:
["RUA VISCONDE DE ITAMARATI, 74 BL 2 / 402"]
telefones
:
[Array(1)]
telefonesAuto
:
["22041027"]
有什么想法吗?