[英]Angular 6 - ERROR DOMException: Failed to execute 'setAttribute' on 'Element':
I'm new with Angular 6 . 我是Angular 6的新手。 I have assigned public property at component.js file and the values are not rendering in the component.html file.
我在component.js文件中分配了公共属性,并且这些值未在component.html文件中呈现。 I have attached chrome log , component.ts and component.html file.
我附加了chrome log,component.ts和component.html文件。
It would be highly appreciated if you can let me know where I'm doing wrong. 如果你能让我知道我做错了什么,我们将不胜感激。
Your error says it so clearly that you are doing something wrong with {{m.name}}
. 您的错误清楚地表明您正在对
{{m.name}}
做错事。 It is trying to add it as an attribute because you mention it inside the attribute
section which is invalid. 它试图将其添加为属性,因为您在
attribute
部分中提及它是无效的。
Move it to the content
section ie between the opening and closing tags. 将其移至
content
部分,即开始和结束标签之间。
Change it this way : 这样改变:
<option *ngFor="let m for data" value="{{m.id}}">{{m.name}}</option>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.