convert time stamp to Date inside angular expression like {{new Date(timestamp)}}

后端 未结 6 1592
旧时难觅i
旧时难觅i 2021-02-05 11:49

Today I found that\'s it\'s not working to convert for a date inside angular expression.

So I just making something like

{{new Date(elem.times         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 12:01

    It is probably best to use a library like moment for this. Also the functionality you are looking for is meant to be implemented via "filters"

    Also see angular-moment

提交回复
热议问题