2016-04-04 45 views
0

私はAngular Xeditable gridを使用しています。上記のグリッド内で使用しているカレンダーコントロールのデフォルトの日付として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

ここでは、

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

です

関連する問題