-2
所以我有一個實體,我希望在保存表單的同時放入當前日期,而沒有輸入該日期。在數據庫中保存當前日期
\t \t \t <tr>
\t <td> Emise aujourdh'hui le : </td>
\t <td > {{dateEmission | date:'dd-MM-yyyy'}}</td>
\t </tr>
和JS是:
//Get current date
$scope.dateEmission = new Date();
//save demande
$scope.savedemande = function() {
\t \t $http.post("/createDemande", $scope.demande).success(function(data) {
\t \t \t if (!data.errors) {
\t \t \t \t $scope.demande=data;
\t \t \t \t $scope.errors = null;
\t \t }
\t \t \t else {
\t \t \t }
\t \t })
\t \t .error(function(data) {
\t \t \t $scope.exception.message=data.message;
\t \t \t
\t \t });
\t };
\t
如何使它成爲它的一部分? –
我假設'$ scope.demande'是一個對象?所以,只要說'$ scope.demande.date – Irshu
這是一個對象。但這不是那種方式! –