Skip to content

Commit cf0751b

Browse files
pbatchupbatchu
authored andcommitted
changed addBill Bills push to use jQUERY extend object
1 parent 73c9868 commit cf0751b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

billrive-client/app/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
-->
117117

118118
<script src="lib/jquery-2.0.0.js"></script>
119-
<script src="lib/angular/angular.js"></script>
120-
<!--<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js"></script>-->
119+
<!--<script src="lib/angular/angular.js"></script>-->
120+
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.js"></script>
121121
<script src="js/app.js"></script>
122122
<script src="js/services.js"></script>
123123
<script src="js/controllers.js"></script>

billrive-client/app/js/controllers.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,18 @@ billRive.controller('BillListCtrl', function($scope, billService) {
6666
billRive.controller('BillAddCtrl', function($scope, billService, $location) {
6767

6868
$scope.addBill = function() {
69-
$scope.bills.push($scope.bill);
69+
$scope.bills.push(jQuery.extend(true, {}, $scope.bill));
7070
$scope.bill = [];
7171
// $scope.bill=billService.getBill();
7272
$location.url('/');
7373
};
74-
});
74+
});
75+
billRive.controller('BillEditCtrl', function($scope, billService, $location,$routeParams) {
76+
$scope.bill = $scope.bills[$routeParams.id];
77+
$scope.edit = function() {
78+
$scope.bills[$routeParams.id] = $scope.bill;
79+
$scope.bill = [];
80+
// $scope.bill=billService.getBill();
81+
$location.url('/');
82+
};
83+
});

billrive-client/app/partials/bills/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<td>{{ ibill.title }}</td>
3737
<td>${{ ibill.billFinances.billTotal }}</td>
3838
<td>
39-
<button class="btn btn-small" href="#editBill">
39+
<button class="btn btn-small" href="#bills/edit/{{$index}}">
4040
<i class="icon-edit"></i>&nbsp;Edit
4141
</button>
4242
</td>

0 commit comments

Comments
 (0)