2016-04-04 71 views
0

我使用Angular Xeditable grid .Could你能告诉我如何设置CURENT日期上,我已经在上面的网格内使用的日历控件默认日期?谢谢。角Xeditable定格当前日期作为默认日期

<tr ng-repeat="comment in vm.comments track by $index"> 
       <td> 
        <span editable-bsdate="comment.date" e-uib-datepicker-popup="MM-dd-yyyy" e-ng-click="opened = !opened" e-is-open="opened" e-name="date" e-form="commentForm" onbeforesave="vm.checkValidity($data)" e-required> 
         {{ comment.date | date:'MM-dd-yyyy' }} 
        </span> 
       </td> 
     </tr> 
<button class="btn btn-primary" ng-click="vm.addComment()">Add</button> 

enter image description here

回答

0

这:)

的js

vm.addComment = function() { 
     vm.comments.push(vm.comment = { 
     date: new Date() 
    }); 
};