Can't bind to 'aria-valuenow' since it isn't a known property of 'div'

前端 未结 3 1589
谎友^
谎友^ 2020-12-07 20:01

What\'s wrong with the following code? Hapenned to me when I tried to assign an expression to an element,

3条回答
  •  [愿得一人]
    2020-12-07 20:26

    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()

    Use instead explicit attribute binding

    attr.aria-valuenow="{{MY_PREC}}" 
    

    or

    [attr.aria-valuenow]="MY_PREC" 
    

提交回复
热议问题