加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Angular中的错误:模板解析错误:无法绑定到’datetime’,因为它

发布时间:2020-12-17 06:49:52 所属栏目:安全 来源:网络整理
导读:我想在Angular中将属性datetime添加到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 kno
我想在Angular中将属性datetime添加到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>

试试吧.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读