code maintenance
This commit is contained in:
@@ -44,14 +44,6 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
||||
|
||||
$scope.postTransaction = function() {
|
||||
|
||||
console.log('postTransaction()');
|
||||
|
||||
// simple HTTP POST
|
||||
// $http.post('/transactions', { "amount" : $scope.amount /* date, */ }).success(function() {
|
||||
// console.log('REFRESH');
|
||||
// $scope.initList();
|
||||
// });
|
||||
|
||||
// via Resource (might be moved into a service)
|
||||
var Transaction = $resource('/transactions');
|
||||
|
||||
@@ -64,18 +56,9 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
||||
"creditor" : $scope.creditor
|
||||
});
|
||||
|
||||
console.log(newTransaction);
|
||||
|
||||
// create copy of transaction object
|
||||
var newTransactionCopy = (JSON.parse(JSON.stringify(newTransaction)));
|
||||
|
||||
$scope.newTransaction = newTransaction;
|
||||
$scope.newTransactionCopy = newTransactionCopy;
|
||||
|
||||
newTransaction.$save(function(transaction, putResponseHeaders) {
|
||||
newTransaction.$save(function(transaction) {
|
||||
$scope.refreshList();
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
$scope.showTransaction = function(transaction) {
|
||||
|
||||
@@ -37,15 +37,7 @@
|
||||
</table>
|
||||
|
||||
<div>
|
||||
<pre style="font-size: 75%; color: darkred;">{{newTransaction | json}}</pre>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<pre style="font-size: 75%; color: darkgreen;">{{newTransactionCopy | json}}</pre>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<pre style="font-size: 75%">{{account | json}}</pre>
|
||||
<pre style="font-size: 75%; color: darkgray;">{{transactions | json}}</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user