Skip to content

Commit

Permalink
JSON converted to seats
Browse files Browse the repository at this point in the history
Still there is a mistake in the JSON object `sessionInfo.checkedSeats` variable, it doesn't contain seats that are selected in different lines such as ( 9G,10G,10H).
  • Loading branch information
rittamdebnath committed Jun 16, 2016
1 parent c922248 commit c81ceba
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ext-modules/quantitySelection/quantityModuleController.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,22 @@ angular.module('quantityModule')

seatsManager.setAvailCount($scope.selectedCount);

// console.log(JSON.stringify(sessionInfo.checkedSeats));
$scope.seatsJSON = [];
var checkedJSON = sessionInfo.checkedSeats;

// moved validation to top of store seat
$window.alert('Thank you for Booking ' + sessionInfo.count + ' seats. ' +
'Your seats are: ' + JSON.stringify(sessionInfo.checkedSeats));
// $scope.seatQuality = null; // keep it active
angular.forEach(checkedJSON, function(v, k) {
angular.forEach(v, function(v, k) {
angular.forEach(v, function(v, k) {
$scope.seatsJSON.push(v);
});
});
});

$scope.seatsJSON = $scope.seatsJSON.join('').match(/[\s\S]{1,2}/g) || [];

$window.alert('Thank you for Booking ' + sessionInfo.count + ' seats. ' +
'Your seats are: '+ $scope.seatsJSON.join(', '));
};

init();
Expand Down

1 comment on commit c81ceba

@rittamdebnath
Copy link
Owner Author

@rittamdebnath rittamdebnath commented on c81ceba Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7 I tried to convert the json to a string of seats but Still there are value missing in the JSON object sessionInfo.checkedSeats, it doesn't contain seats that are selected in different lines such as ( 9G,10G,10H) once see this problem.

Please sign in to comment.