通常的后台管理中,几乎每一个管理后台都有设置新密码的功能,可是获取的时候为了好看,都有统一用必定的标签,好比input标签,ng-model来控制显示数据,可是在获取时间的时候用会显示错乱express
代码为:api
<input type="text" ng-model="currentCom.createTime" style="width: 260px;" timeFormat="HH:mm:ss" disabled/>
也改用了其余人分享经验中所给出的方案。spa
好比:code
一、<input type="text" disabled="" style="width: 260px;" data-date-formats="yyyy-MM-dd hh:mm:ss" /> 二、<input type="text" ng-model="currentCom.createTime" style="width: 260px;" format="yyyy-MM-dd HH:mm:ss" disabled/>
可是仍是依旧出现以下的错误
后面想了想ng-model是控制显示数据,那我是否能够用别的元素来替换ng-model呢?后面去查了一些官网的api给出an-value的介绍。orm
It can also be used to achieve one-way binding of a given expression to an input element such as an input[text]
or a textarea
, when that element does not use ngModel.blog
以后改换了控制显示数据的元素:element
<input type="text" ng-value="currentCom.createTime|date:'yyyy/MM/dd HH:mm:ss'" style="width: 260px;" disabled/>