Angular 角度8错误:无法读取属性';属性资源系统&x27;未定义的
我对angular是个新手,我有点纠结于打字错误Angular 角度8错误:无法读取属性';属性资源系统&x27;未定义的,angular,typescript,ngmodel,Angular,Typescript,Ngmodel,我对angular是个新手,我有点纠结于打字错误 Cannot read property 'attributeSourceSystem' of undefined Html内容 <p-dropdown class="p-primeNg" placeholder="Source" [options]="lookupDataSourceNgDropdown" [(ngModel)]="selectedAttributeObj.attributeSourceSystem"
Cannot read property 'attributeSourceSystem' of undefined
Html内容
<p-dropdown class="p-primeNg" placeholder="Source" [options]="lookupDataSourceNgDropdown" [(ngModel)]="selectedAttributeObj.attributeSourceSystem"
(ngModelChange)="selectAttributeSourceSystem(selectedAttributeObj); checkFilter('ROW');" optionLabel="templateName"
[filter]="true"></p-dropdown>
有人知道如何解决吗?如果你想解决,你必须避免使用双向绑定,只使用[ngModel]和“elvis”操作符
?
来解决这个选择的属性bj?.attributeSourceSystem
<p-dropdown class="p-primeNg" placeholder="Source" [options]="lookupDataSourceNgDropdown" [ngModel]="selectedAttributeObj?.attributeSourceSystem"
(ngModelChange)="selectAttributeSourceSystem(selectedAttributeObj); checkFilter('ROW');" optionLabel="templateName"
[filter]="true"></p-dropdown>
您应该看看这里:请在问题中包括attributeSourceSystem的结构?