今天,在项目中遇到个问题,在列表页,要将数据源中的某一个时间字段,作为参数传递。因为数据源的时间格式是:/Date(1467698351787)/,所以需要在ng-click中进行转换。
<table> <tbody ng-repeat="x in List"> <tr> <td width=50> <a ng-if="x.Status==20" ng-click="openWin(x.Id,(x.EndTime|jsonDate:'yyyy-MM-dd HH:mm:ss'))" title="修改活动时间"><i class="fa fa-calendar"></i></a> </td> </tr> </tbody> </table>
如图,
默认绑定数据:ng-bind="activity.EndTime|jsonDate:'yyyy-MM-dd HH:mm:ss'">
如果在ng-click中使用过滤器,需要将参数整体用()括起来。
新手,望指教...