'use strict'; angular.module('acufuel') .controller('fuelOrdersController', ['$scope', '$rootScope', '$uibModal', '$filter', '$http', 'NgTableParams','$stateParams','fuelOrdersService','CustomersService','ViewCompanyService', fuelOrdersController]); function fuelOrdersController($scope, $rootScope, $uibModal, $filter, $http, NgTableParams,$stateParams,fuelOrdersService,CustomersService,ViewCompanyService) { $scope.showFuelOrderModal = false; $scope.optionSelected; $scope.orderdata = {}; $scope.showLoader = false; $scope.jetShow = []; $scope.marginShow = []; $scope.jetShow[0] = true; $scope.marginShow[0] = true; $scope.data = {}; $scope.order = {}; $scope.dispatchOrder = {}; $scope.dispatchOrder.fuelOrderList = []; $scope.defaultStatus = ''; $scope.statusFilterOptions = []; $scope.statusFilterOptions.push({ 'id': '', 'title': 'Show All' },{ 'id': 'pending', 'title': 'Pending' },{ 'id': 'invoiced', 'title': 'Invoiced' },{ 'id': 'paid', 'title': 'Paid' },{ 'id': 'cancelled', 'title': 'Cancelled' },{ 'id': 'archived', 'title': 'Archived' } ); if($stateParams.status =="paid"){ $scope.defaultStatus = "paid"; } getAllCompanies(); function getAllCompanies(){ fuelOrdersService.getAllCompanies().then(function(result) { $scope.companyList = result; for (var i = 0; i < $scope.companyList.length; i++) { if ($scope.companyList[i].companyContact != null) { if ($scope.companyList[i].companyContact.contactNumber != null || $scope.companyList[i].companyContact.contactNumber != undefined) { $scope.companyList[i].newContactNumber = $scope.companyList[i].companyContact.contactNumber; } } if ($scope.companyList[i].primaryContact != null) { if ($scope.companyList[i].primaryContact.firstName != null && $scope.companyList[i].primaryContact.lastName != null) { $scope.companyList[i].primaryContactName = $scope.companyList[i].primaryContact.firstName + ' ' + $scope.companyList[i].primaryContact.lastName; } } if ($scope.companyList[i].margin != null) { if ($scope.companyList[i].margin.marginName != null) { $scope.companyList[i].masterMargin = $scope.companyList[i].margin.id; } } } $scope.displayCompanyList = new NgTableParams({ page: 1, count: 10, }, { data: $scope.companyList }); $scope.showLoader = false; }) } $scope.userProfileId = JSON.parse(localStorage.getItem('userProfileId')) $scope.reset2 = function(){ $("input").val(""); $scope.removeMarginValidation(); } function colourFunction() { var myselect = document.getElementById('colorfulSelectbox'), colour = myselect.options[myselect.selectedIndex].className; myselect.style.background = colour; myselect.blur(); } /*setInterval(function(){ colourFunction(); }, 1)*/ $scope.attachmentFilterOptions = []; $scope.attachmentFilterOptions.push({ 'id': '', 'title': 'Show All' },{ 'id': '!null', 'title': 'Attachments' },{ 'id': 'null', 'title': 'No Attachments' } ); // $(document).ready(function() { // $scope.showLoader = true; // $('#example').DataTable(); // $scope.showLoader = false; // }); $scope.getOrders = function() { fuelOrdersService.getOrders().then(function(result) { $scope.orderdata = result; for(var i=0 ; i < $scope.orderdata.length ; i++){ $scope.orderdata[i].upliftDateS = new Date($scope.orderdata[i].upliftDate); $scope.orderdata[i].departingDateS = new Date($scope.orderdata[i].departingDate); $scope.orderdata[i].fuelingDate = new Date($scope.orderdata[i].fuelingDate); var str = "" + ($scope.orderdata[i].upliftDateS.getMonth() + 1) + "/" + $scope.orderdata[i].upliftDateS.getDate() + "/" + $scope.orderdata[i].upliftDateS.getFullYear(); var departingStr = "" + ($scope.orderdata[i].departingDateS.getMonth() + 1) + "/" + $scope.orderdata[i].departingDateS.getDate() + "/" + $scope.orderdata[i].departingDateS.getFullYear(); // var fuelingDateStr = "" + ($scope.orderdata[i].fuelingDate.getMonth() + 1) + "/" + $scope.orderdata[i].fuelingDate.getDate() + "/" + $scope.orderdata[i].fuelingDate.getFullYear(); $scope.orderdata[i].upliftDateString = str; $scope.orderdata[i].departingDateString = departingStr; // $scope.orderdata[i].fuelingDate = fuelingDateStr; } // console.log("==result===",$scope.orderdata) $scope.displayFuelOrderList = new NgTableParams({ page: 1, count: 50, }, { data: $scope.orderdata }); $(document).ready(function(){ function changeSelectboxBg(){ setInterval(function(){ if ($('.table select').is(':focus')) { }else{ var myselect = document.getElementsByClassName('colorfulSelectbox'); for (var i = 0; i < myselect.length; i++) { var colourIndex = $(myselect[i]).prop('selectedIndex'); colourIndex = colourIndex + 1; var getColor = $('.colorfulSelectbox option:nth-child('+colourIndex+')').css('color'); $(myselect[i]).css('background-color', getColor); myselect[i].blur(); } } }, 1000) } changeSelectboxBg(); // console.log("=====$scope.displayFuelOrderList====",$scope.displayFuelOrderList) /*$('.pagination , .recordCountSelect').click(function(){ changeSelectboxBg(); }) $('.input-filter').keydown(function(){ console.log('function..........'); changeSelectboxBg(); })*/ }) }) } $scope.getOrders(); $scope.optionSelected=''; $scope.onFWSelect = function() { if($scope.optionSelected == 'dt'){ $('#demo-modal-4').css('display', 'block'); $scope.optionSelected=''; } if($scope.optionSelected == 'efo'){ $scope.showLoader = true; var fileName = "orders.csv"; var a = document.createElement("a"); document.body.appendChild(a); fuelOrdersService.exportCompany().then(function(result) { var file = new Blob([result], {type: 'application/csv'}); var fileURL = URL.createObjectURL(file); a.href = fileURL; a.download = fileName; a.click(); $scope.showLoader = false; $scope.optionSelected=''; }) } } $scope.attachmentrowid = "" $scope.attachment = function(id, value, url) { $scope.attachmentrowid = id if(value == 'uploadAttachment'){ $('#demo-modal-6').css('display', 'block'); }else if(value == 'viewAttachment'){ var win = window.open(url, '_blank'); win.focus(); }else if(value == 'deleteAttachment'){ $('#delete1').css('display', 'block'); } } $scope.cancelDeleteAttachment = function() { $('#delete1').css('display', ''); } $scope.deleteAttachment = function() { $scope.showLoader = true; fuelOrdersService.deleteAttachment($scope.attachmentrowid).then(function(result) { if(result.success){ toastr.success(''+result.success+'', { closeButton: true }) } }) $scope.showLoader = false; $('#delete1').css('display', ''); } $scope.saveUploadAttachment = function(attachmentData) { $scope.showLoader = true; $scope.data.media = attachmentData $scope.data.id = $scope.attachmentrowid fuelOrdersService.uploadAttachment($scope.data).then(function(result) { if(result){ toastr.success(''+"Upload Successful"+'', { closeButton: true }) } }) $scope.showLoader = false; $('#demo-modal-6').css('display', 'none'); } $scope.cancelUploadAttachment = function() { $('#demo-modal-6').css('display', 'none'); } $scope.editdata = {}; $scope.editTableRow = function(rowData){ //console.log('row data', rowData); $scope.editdata = rowData; $('#demo-modal-5').css('display', 'block'); } $scope.updateTotal = function(value, valueOf){ if(valueOf == 'v'){ $scope.editdata.total = value * $scope.editdata.invoiced }else if(valueOf == 'i'){ $scope.editdata.total = $scope.editdata.requestedVolume * value } } $scope.setCost = function(cost){ if(cost != null) { var obj =JSON.parse(cost); $scope.order.fboCost = obj.cost; } } $scope.addTotal = function(value, valueOf) { if (value != undefined && valueOf != undefined) { value = JSON.parse(value) $scope.order.total = Math.abs(value.papTotal) * valueOf; } } $scope.addFuelData = function() { $scope.showLoader = true; $scope.fuelData = {}; $scope.fuelData.companyId = $scope.selectedCompanyId; $scope.fuelData.companyName = $scope.order.companyName; var aircraftObj =JSON.parse($scope.order.aircraftName); $scope.fuelData.aircraftName = aircraftObj.tail; $scope.fuelData.make = aircraftObj.make; $scope.fuelData.model = aircraftObj.model; // $scope.fuelData.fuelOn = $scope.order.fuelOn; $scope.fuelData.invoiced = $scope.order.invoiced; $scope.fuelData.volume = $scope.order.volume; // $scope.fuelData.source = $scope.order.source; $scope.fuelData.total = $scope.order.total; //tier no use $scope.fuelData.tierBreak = $scope.order.tierBreak; var obj =JSON.parse($scope.order.priceQuote); $scope.fuelData.priceQuote = obj.papTotal; $scope.fuelData.fboCost = obj.cost; $scope.fuelData.productName = obj.productName; $scope.fuelData.etaTime = $scope.order.etaTime; $scope.fuelData.etdTime = $scope.order.etdTime; $scope.fuelData.certificateType = $scope.order.certificateType; var currentDate = new Date(); var hours = currentDate.getHours(); var min = currentDate.getMinutes(); var sec = currentDate.getSeconds(); if ($scope.order.upliftDate != '') { $scope.order.upliftDate = $scope.order.upliftDate + ' ' + hours + ':' + min + ':' + sec; $scope.order.upliftDate = new Date($scope.order.upliftDate); $scope.fuelData.upliftDate = $scope.order.upliftDate.getTime(); } if ($scope.order.departingDate != '') { $scope.order.departingDate = $scope.order.departingDate + ' ' + hours + ':' + min + ':' + sec; $scope.order.departingDate = new Date($scope.order.departingDate); $scope.fuelData.departingDate = $scope.order.departingDate.getTime(); } if($scope.order.status === null || $scope.order.status === undefined){ $scope.fuelData.status = "pending"; //default status }else { $scope.fuelData.status = $scope.order.status; } if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ $scope.fuelData.fuelOn = "Arrival"; //default fuelon }else { $scope.fuelData.fuelOn = $scope.order.fuelOn ; } if($scope.baseTenant && $scope.contractFuelVendor ){ $scope.fuelData.source = "Tenant/CAA" ; }else if($scope.baseTenant) { $scope.fuelData.source = "Tenant/Base Customer"; }else if($scope.contractFuelVendor){ $scope.fuelData.source = "CAA Member"; } $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); // console.log("=====$scope.fueldata======",$scope.fuelData) fuelOrdersService.dispathFuelOrder($scope.dispatchOrder).then(function(result) { $scope.showLoader = false; $scope.order = {}; $scope.dispatchOrder.fuelOrderList = []; $scope.fuelData.source=''; $scope.baseTenant=false; $scope.contractFuelVendor=false; $('#demo-modal-4').css('display', ''); $scope.getOrders(); toastr.success('Fuel Order Dispatched Successfully', { closeButton: true }) }) } $scope.updateStatus = function(row, status) { $scope.showLoader = true; $scope.fuelData = {}; $scope.fuelData.aircraftName = row.aircraftName $scope.fuelData.companyName = row.companyName $scope.fuelData.departingDate = row.departingDate $scope.fuelData.fboCost = row.fboCost $scope.fuelData.id = row.id $scope.fuelData.invoiced = row.invoiced $scope.fuelData.priceQuote = row.priceQuote $scope.fuelData.volume = row.requestedVolume $scope.fuelData.source = row.source $scope.fuelData.status = status $scope.fuelData.tierBreak = row.tierBreak $scope.fuelData.total = row.total $scope.fuelData.upliftDate = row.upliftDate $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { $scope.showLoader = false; $scope.editdata = {}; $scope.fuelData = {}; $scope.dispatchOrder.fuelOrderList = []; $('#demo-modal-5').css('display', ''); $scope.getOrders(); toastr.success('Fuel Order Updated Successfully', { closeButton: true }); }) } $scope.fuelData = {}; $scope.updateData = function() { if($scope.editdata.etaTime != null && $scope.editdata.etdTime != null){ $scope.showLoader = true; $scope.fuelData.aircraftName = $scope.editdata.aircraftName; $scope.fuelData.companyName = $scope.editdata.companyName; $scope.fuelData.fboCost = $scope.editdata.fboCost; $scope.fuelData.id = $scope.editdata.id; $scope.fuelData.invoiced = $scope.editdata.invoiced; $scope.fuelData.priceQuote = $scope.editdata.priceQuote; $scope.fuelData.volume = $scope.editdata.requestedVolume; $scope.fuelData.source = $scope.editdata.source; $scope.fuelData.status = $scope.editdata.status; $scope.fuelData.tierBreak = $scope.editdata.tierBreak; $scope.fuelData.total = $scope.editdata.total; var currentDate = new Date(); var hours = currentDate.getHours(); var min = currentDate.getMinutes(); var sec = currentDate.getSeconds(); $scope.editdata.upliftDateString = $scope.editdata.upliftDateString + ' ' + hours + ':' + min + ':' + sec; $scope.editdata.upliftDateString = new Date($scope.editdata.upliftDateString); $scope.editdata.upliftDateString = $scope.editdata.upliftDateString.getTime(); $scope.editdata.departingDateString = $scope.editdata.departingDateString + ' ' + hours + ':' + min + ':' + sec; $scope.editdata.departingDateString = new Date($scope.editdata.departingDateString); $scope.editdata.departingDateString = $scope.editdata.departingDateString.getTime(); $scope.fuelData.upliftDate = $scope.editdata.upliftDateString; $scope.fuelData.departingDate = $scope.editdata.departingDateString; $scope.fuelData.productName = $scope.editdata.productName; /*$scope.fuelData.etaTime = $scope.editdata.etaTime.toLocaleTimeString(); $scope.fuelData.etdTime = $scope.editdata.etdTime.toLocaleTimeString();*/ $scope.fuelData.etaTime = $scope.editdata.etaTime; $scope.fuelData.etdTime = $scope.editdata.etdTime; $scope.fuelData.certificateType = $scope.editdata.certificateType; // $scope.fuelData.fuelOn = $scope.editdata.fuelOn; if($scope.fuelData.fuelOn === null || $scope.fuelData.fuelOn ===undefined){ $scope.fuelData.fuelOn = "Arrival"; //default fuelon }else { $scope.fuelData.fuelOn = $scope.editdata.fuelOn ; } $scope.dispatchOrder.fuelOrderList.push($scope.fuelData); fuelOrdersService.updateFuelOrder($scope.dispatchOrder).then(function(result) { $scope.showLoader = false; $scope.editdata = {}; $('#demo-modal-5').css('display', ''); $scope.getOrders(); toastr.success('Fuel Order Updated Successfully', { closeButton: true }) }) }else { toastr.error('Please select Arrival Time and Departure time both.', { closeButton: true }) } } $scope.getAircraft = function(company){ $scope.selectedCompanyName = company; //$scope.showLoader = true; for (var i = 0; i < $scope.companyList.length; i++) { if ($scope.companyList[i].companyName == company) { $scope.order.certificateType = $scope.companyList[i].certificateType; $scope.baseTenant = $scope.companyList[i].baseTenant; $scope.contractFuelVendor = $scope.companyList[i].contractFuelVendor; $scope.fuelerlinxCustomer = $scope.companyList[i].fuelerlinxCustomer; if($scope.companyList[i].margin != null && $scope.companyList[i].marginAVGAS != null){ fuelOrdersService.getFuelCost($scope.companyList[i].id).then(function(margins) { $scope.marginList = margins; }) } else if ($scope.companyList[i].margin != null || $scope.companyList[i].marginAVGAS == null) { fuelOrdersService.getATypeFuelPricing($scope.companyList[i].id).then(function(margins) { $scope.marginList = margins; }) } else if ($scope.companyList[i].margin == null || $scope.companyList[i].marginAVGAS != null) { fuelOrdersService.getVTypeFuelPricing($scope.companyList[i].id).then(function(margins) { $scope.marginList = margins; }) } $scope.selectedCompanyId = $scope.companyList[i].id; $scope.marginId = $scope.companyList[i].margin.id; if ($scope.selectedCompanyId != '') { fuelOrdersService.getAircraft($scope.selectedCompanyId).then(function(aircraft) { $scope.aircraftList = aircraft; }) } if ($scope.marginId != '') { fuelOrdersService.getJetTiers($scope.marginId).then(function(tiers) { $scope.tierList = tiers; // $scope.showLoader = false; }) }else{ // $scope.showLoader = false; } } } } $scope.cancelData = function() { $('#demo-modal-4').css('display', ''); } $scope.canceleditdata = function() { $('#demo-modal-5').css('display', ''); } $scope.companyList = {}; fuelOrdersService.getAllCompanies().then(function(result) { $scope.showLoader = true; $scope.companyList = result; $scope.showLoader = false; }) /*Add a company services API used from customersService */ getCompanyName(); function getCompanyName(){ CustomersService.getCompanyName().then(function(result) { $scope.showLoader = true; $scope.compNameList = result; $scope.showLoader = false; }) } $scope.marginFilterOptions = []; CustomersService.getJetMargin($scope.userProfileId).then(function(result) { $scope.showLoader = true; $scope.jetMarginList = result; $scope.marginFilterOptions.push({ 'id': '', 'title': 'Show All' }); for (var i = 0; i < result.length; i++) { $scope.marginFilterOptions.push({ 'id': result[i].id, 'title': result[i].marginName }) } $scope.showLoader = false; }) CustomersService.getAvgMargin($scope.userProfileId).then(function(result) { $scope.avgsMarginList = result; }) $scope.showCompanyError = false; $scope.showMarginError = false; $scope.removeValidation = function(){ $scope.showCompanyError = false; $('.companyNameInput').removeClass('customErrorInput'); if($scope.data.companyName == 'undefined' || $scope.data.companyName == '') { $('.companyNameInput').addClass('customErrorInput'); $scope.showCompanyError = true; } } $scope.removeMarginValidation = function(){ $scope.showMarginError = false; $('.marginSelectBox').removeClass('customErrorInput'); } getData(); function getData(){ $scope.showLoader = true; CustomersService.getAircraftMake().then(function(result) { $scope.aircraftMakeList = result; $scope.showLoader = false; }) } var companyData; $scope.addFirstData = function(sel, step){ $scope.showLoader = true; if($scope.data.companyName == undefined){ $scope.showCompanyError = true; $('.companyNameInput').addClass('customErrorInput'); }else if($scope.data.masterMargin == undefined){ $scope.showMarginError = true; $('.marginSelectBox').addClass('customErrorInput'); }else{ $scope.aircraftDetails = [{ 'tail':'', 'make': '', 'model': '', 'sizeId' : '', 'marginId': $scope.data.masterMargin, 'avgasMarginId': $scope.data.avgasMargin }]; $(sel).trigger('next.m.' + step); getData(); } $scope.showLoader = false; } $scope.addNew = function(){ $scope.showLoader = true; $scope.aircraftDetails.push({ 'tail':'', 'make': '', 'model': '', 'sizeId' : '', 'marginId': $scope.data.masterMargin, 'avgasMarginId': $scope.data.avgasMargin }); $scope.showLoader = false; }; $scope.aircraft = {}; $scope.getModal = function(makeId, index){ $scope.showLoader = true; $scope.aircraft.make = makeId; CustomersService.getModal($scope.aircraft.make).then(function(result) { $scope.showLoader = false; $scope.aircraftDetails[index].aircraftModalList = result; //$scope.aircraftDetails[index].model = $scope.aircraftModalList[0]; }) } $scope.getSize = function(model, index){ $scope.showLoader = true; CustomersService.getAircraftSize($scope.aircraft.make, model).then(function(result) { $scope.showLoader = false; $scope.aircraftDetails[index].aircraftSizeList = result; //$scope.aircraftDetails[index].size = $scope.aircraftSizeList[0]; }) } $scope.aircraftListData = {}; $scope.addData = []; $scope.saveCompanyData = function(){ CustomersService.addCompany($scope.data).then(function(result) { $scope.accountId = result; $scope.aircraft.accountId = $scope.accountId; for(var i=0; i<$scope.aircraftDetails.length;i++){ $scope.addData.push({ 'tail': $scope.aircraftDetails[i].tail, 'make': $scope.aircraftDetails[i].make, 'model': $scope.aircraftDetails[i].model, 'sizeId' : $scope.aircraftDetails[i].sizeId, 'marginId': $scope.aircraftDetails[i].marginId, 'avgasMarginId': $scope.aircraftDetails[i].avgasMarginId }); } $scope.aircraftListData.aircraftList = $scope.addData; $scope.aircraftListData.accountId = $scope.aircraft.accountId; if($scope.aircraftListData.aircraftList[0].tail == "" || $scope.aircraftListData.aircraftList[0].make == null || $scope.aircraftListData.aircraftList[0].model == null){ $scope.aircraftListData.aircraftList = []; } CustomersService.addAircraft($scope.aircraftListData).then(function(result) { if(result != null && result.success){ toastr.success(''+result.success+'', { closeButton: true }) $('#demo-modal-3').modal('hide'); getAllCompanies(); }else{ toastr.error(''+result.statusText+'', { closeButton: true }) } }); }) } $scope.checkJetWithTail = function(tail, index){ ViewCompanyService.checkJetType(tail).then(function(result) { if(result.jetA == "true"){ $scope.jetShow[index] = false; $scope.marginShow[index] = true; }else{ $scope.jetShow[index] = true; $scope.marginShow[index] = false; } }) } $scope.etaTimeList=[]; $scope.etdTimeList =[]; $scope.sourceList = [{source:"Direct Jet-A"},{source:"Direct AVGAS 100LL"}]; $scope.etaTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; $scope.etdTimeList = [{time:"12:00 AM"},{time:"12:30 AM"},{time:"01:00 AM"},{time:"01:30 AM"},{time:"02:00 AM"},{time:"02:30 AM"},{time:"03:00 AM"},{time:"03:30 AM"}, {time:"04:00 AM"},{time:"04:30 AM"},{time:"05:00 AM"},{time:"05:30 AM"},{time:"06:00 AM"},{time:"06:30 AM"},{time:"07:00 AM"},{time:"07:30 AM"}, {time:"08:00 AM"},{time:"08:30 AM"},{time:"09:00 AM"},{time:"09:30 AM"},{time:"10:00 AM"},{time:"10:30 AM"},{time:"11:00 AM"},{time:"11:30 AM"}, {time:"12:00 PM"},{time:"12:30 PM"},{time:"01:00 PM"},{time:"01:30 PM"},{time:"02:00 PM"},{time:"02:30 PM"},{time:"03:00 PM"},{time:"03:30 PM"}, {time:"04:00 PM"},{time:"04:30 PM"},{time:"05:00 PM"},{time:"05:30 PM"},{time:"06:00 PM"},{time:"06:30 PM"},{time:"07:00 PM"},{time:"07:30 PM"}, {time:"08:00 PM"},{time:"08:30 PM"},{time:"9:00 PM"},{time:"09:30 PM"},{time:"10:00 PM"},{time:"10:30 PM"},{time:"11:00 PM"},{time:"11:30 PM"},]; $scope.data = {}; }