From 6beb446925c967aca92f5513adf36c5db77c00d6 Mon Sep 17 00:00:00 2001 From: TATTAVARADA Date: Thu, 27 Apr 2017 07:53:18 -0400 Subject: [PORTAL-7] Rebase This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: Ia1efa4deacdc5701e6205104ac021a6c80ed60ba Signed-off-by: st782s --- .../fusion/scripts/DS2-services/modalService.js | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js new file mode 100644 index 00000000..cb85ffce --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-services/modalService.js @@ -0,0 +1,57 @@ + +angular.module("template/modalsAndAlerts/window2.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("template/modalsAndAlerts/window.html", + "
\n" + + "
sdfdsfsfd
\n" + + "
"); + }]); + +angular.module('ddh.att.modalsAndAlerts') + +.controller('modalsAndAlertsController', function ($scope, $modal, $log) { + $scope.name='eeee'; + $scope.items = ['item1', 'item2', 'item3']; + $scope.dt = new Date("March 10, 2014 00:00:00"); + $scope.helperText = "The date you selected is $date. Double tap to open calendar. Select a date to close the calendar."; + $scope.open = function (event) { + var modalInstance = $modal.open({ + templateUrl: 'template/modalsAndAlerts/modal-demo.html', + controller: ModalInstanceCtrl, + sizeClass: 'modal-long-adjust', + resolve: { + items: function () { + return $scope.items; + } + } + }); + + modalInstance.result.then(function (selectedItem) { + $scope.selected = selectedItem; + event.target.focus(); + }, function () { + $log.info('Modal dismissed at: ' + new Date()); + event.target.focus(); + }); + }; + $scope.ok = function () { + //add the ok functionality + console.log("ok"); + }; + $scope.cancel = function () { + //add the cancel functionality + console.log("cancel"); + }; +}) + +var ModalInstanceCtrl = function ($scope, $modalInstance, items) { + $scope.items = items; + $scope.selected = { + item: $scope.items[0] + }; + $scope.ok = function () { + $modalInstance.close($scope.selected.item); + }; + $scope.cancel = function () { + $modalInstance.dismiss('cancel'); + }; +}; -- cgit 1.2.3-korg