gpt4 book ai didi

angular - Angular 错误 : Template parse errors: Can't bind to 'datetime' since it isn't a known property of 'time'

转载 作者:太空狗 更新时间:2023-10-29 17:32:00 25 4
gpt4 key购买 nike

我想将属性 datetime 添加到 Angular 中的 time 元素:

<time 
class="updated"
[datetime]="post.modified_gmt">
{{ post.modified_gmt | date: 'short'}}
</time>

但是得到下一个错误:

Error: Template parse errors: Can't bind to 'datetime' since it isn't a known property of 'time'. (" class="entry-date published">{{ post.date_gmt | date: 'short'}}

有什么解决办法?感谢您的帮助

最佳答案

更正小写的 [dateTime]

<time 
class="updated"
[dateTime]="post.modified_gmt">

{{ post.modified_gmt | date: 'short'}}

</time>

试一试。

关于angular - Angular 错误 : Template parse errors: Can't bind to 'datetime' since it isn't a known property of 'time' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47429179/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com