Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Controller for date-time |
| 3 | * |
| 4 | * @module app/configuration |
| 5 | * @exports dateTimeController |
| 6 | * @name dateTimeController |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 9 | window.angular && (function(angular) { |
| 10 | 'use strict'; |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 11 | |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 12 | angular.module('app.configuration').controller('dateTimeController', [ |
Gunnar Mills | 7de3866 | 2018-07-18 13:01:48 -0500 | [diff] [blame^] | 13 | '$scope', '$window', 'APIUtils', |
| 14 | function($scope, $window, APIUtils) { |
| 15 | $scope.bmc_time = ''; |
| 16 | $scope.loading = true; |
| 17 | |
| 18 | var getBMCTimePromise = APIUtils.getBMCTime().then( |
| 19 | function(data) { |
| 20 | $scope.bmc_time = data.data.Elapsed / 1000; |
| 21 | }, |
| 22 | function(error) { |
| 23 | console.log(JSON.stringify(error)); |
| 24 | }); |
| 25 | |
| 26 | getBMCTimePromise.finally(function() { |
| 27 | $scope.loading = false; |
| 28 | }); |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 29 | } |
| 30 | ]); |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 31 | })(angular); |