2017-09-03 57 views
2

我在ionic3项目的html页面中使用了一些javascript。ionic3使用ref attr在span标记html

<span id="time" ref="{{product.time}}"></span> 

但当建设项目有以下错误:

Can't bind to 'ref' since it isn't a known property of 'span'. 

有谁知道如何解决这个问题?非常感谢。

+0

什么是'ref'这里?那是自定义属性? – Sampath

+0

你能解决这个问题吗? – sebaferreras

+0

对不起,最后我用角度方式ngmodel来解决问题 – Nulra

回答

1

如果你想设置一个自定义属性,您可以使用attribute binding这样的:

<span id="time" [attr.ref]="product.time"></span>