Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.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 角度2 4 5-无法读取属性';名称';未定义的角5_Angular_Angular5 - Fatal编程技术网

Angular 角度2 4 5-无法读取属性';名称';未定义的角5

Angular 角度2 4 5-无法读取属性';名称';未定义的角5,angular,angular5,Angular,Angular5,对不起,有点英语 我想要:在后端服务器通信后在视图中显示。 或其他解决方案 view.html 临时决议 view.html userId:{{element.userId} 品牌名称:{{elemnet.brand?.name}==>Resolve 我想解决这个问题 多谢各位 祝你愉快。你的临时解决方案不是临时的,而是正确的 Temporary resolution view.html <label> userId : {{ element.userId }} <la

对不起,有点英语

我想要:在后端服务器通信后在视图中显示。 或其他解决方案

view.html

临时决议

view.html

userId:{{element.userId}
品牌名称:{{elemnet.brand?.name}==>Resolve
我想解决这个问题

多谢各位


祝你愉快。

你的临时解决方案不是临时的,而是正确的

Temporary resolution

view.html

<label> userId : {{ element.userId }} 
<label> brandName : {{ elemnet.brand?.name }} ==> Resolve =>> Keep this solution
临时解决方案
view.html
用户标识:{{element.userId}
brandName:{{elemnet.brand?.name}==>Resolve=>>保留此解决方案

您的临时解决方案不是临时的,而是正确的

Temporary resolution

view.html

<label> userId : {{ element.userId }} 
<label> brandName : {{ elemnet.brand?.name }} ==> Resolve =>> Keep this solution
临时解决方案
view.html
用户标识:{{element.userId}
brandName:{{elemnet.brand?.name}==>Resolve=>>保留此解决方案

您可以尝试此解决方案

<label> userId : {{ element?.userId }} 
<label> brandName : {{ elemnet?.brand?.name }}
userId:{{element?.userId}
品牌名称:{{elemnet?.brand?.name}

您可以尝试此解决方案

<label> userId : {{ element?.userId }} 
<label> brandName : {{ elemnet?.brand?.name }}
userId:{{element?.userId}
品牌名称:{{elemnet?.brand?.name}
试试这个

userId:{{element.userId}}

brandName:{{element.brand.name}

在component.ts文件中,不初始化元素。就这样吧

公共元素

试试这个

userId:{{element.userId}}

brandName:{{element.brand.name}

在component.ts文件中,不初始化元素。就这样吧


公共元素

您的回答只有一个元素?还是对象数组?您的响应只有一个元素?还是一系列的东西?谢谢。我想要在typescript中初始化对象。(像接口或类)示例)元素:{userId:string,brand:{id:number,name:string}我试过了,但出现了一个错误。谢谢。我想要在typescript中初始化对象。(像接口或类)示例)元素:{userId:string,brand:{id:number,name:string}我试过了,但出现了一个错误。
<label> userId : {{ element?.userId }} 
<label> brandName : {{ elemnet?.brand?.name }}