<script type="text/javascript"> var module = angular.module("myApp",[]);
module.controller("myController",['$scope',"$filter",function($scope,$filter){
$scope.date = new Date(); //2017-02-11 15:36:40
$scope.date = $filter("date")($scope.date,"yyyy-MM-dd HH:mm:ss")
}]) var tpl = "日期:yyyy-MM-d";
var result = tpl.replace(/(y{1,4})[^yMd]*(M{1,2})[^yMd](d{1,2})/gi,function($1,$2,$3,$4,$5,$6,$7){
console.log(arguments);
})
</script>解释,打印出来的第四项那个3是什么意思???
添加回答
举报
0/150
提交
取消