Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度8错误:无法读取属性';属性资源系统&x27;未定义的_Angular_Typescript_Ngmodel - Fatal编程技术网

Angular 角度8错误:无法读取属性';属性资源系统&x27;未定义的

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"

我对angular是个新手,我有点纠结于打字错误

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的结构?