无法绑定到"aria-valuenow",因为它不是"div"的已知属性 [英] Can't bind to 'aria-valuenow' since it isn't a known property of 'div'
本文介绍了无法绑定到"aria-valuenow",因为它不是"div"的已知属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码有什么问题? 当我尝试将表达式分配给元素时,对我产生了冲击,
What's wrong with the following code? Hapenned to me when I tried to assign an expression to an element,
<div class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="{{MY_PREC}}" aria-valuemin="0" aria-valuemax="100" >
{{MY_PREC}}
</div>
也尝试过
[aria-valuenow]={{MY_PREC}}
似乎自RC5起就发生了
Seem like it happens since RC5
有什么想法吗?
推荐答案
默认情况下,Angular2绑定是属性绑定.如果没有应用具有这样的@Input()
Angular2 binding is property binding by default. There is no aria-valuenow
property on div
if there is no directive or component applied that has such an @Input()
使用显式属性绑定
attr.aria-valuenow="{{MY_PREC}}"
或
[attr.aria-valuenow]="MY_PREC"
这篇关于无法绑定到"aria-valuenow",因为它不是"div"的已知属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文