美文网首页
angular2 datepipe 在ios中出错的解决方案

angular2 datepipe 在ios中出错的解决方案

作者: 索易开发 | 来源:发表于2016-08-25 08:45 被阅读0次

在angular2中格式化日期可用以下方式:
<span>上次消费:{{card.lastDate}}</span>
但在ios不会有任何效果

解决方法:
npm install --save intl
另外在index.html中加入
<script src="node_modules/intl/dist/Intl.js"></script>
<script src="node_modules/intl/locale-data/jsonp/en.js"></script>

ok,到此这问题就完美解决了,另外说明下local-data下面有多种语言的格式可以参考!

相关文章

网友评论

      本文标题:angular2 datepipe 在ios中出错的解决方案

      本文链接:https://www.haomeiwen.com/subject/ligosttx.html