Sha256: 9d5c8c183658e10be1ae46a4686eabc83437e17b4752698a1351641f2e57b4e1

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

(function (angular) {
  'use strict';

  angular.module('ac.tabloSync', [])
      .directive('tabloSync', [function () {
        return {
          restrict: 'E',
          replace: true,
          templateUrl: '/assets/tablo_connect/ng_app/modules/tablo_sync/templates/tablo_sync.html',
          controller: ['$scope', 'tabloSyncService', 'alertsService', function ($scope, tabloSyncService, alertsService) {
            $scope.syncing = false;

            $scope.syncRecordings = function () {
              alertsService.clearAlerts();
              $scope.syncing = true;

              tabloSyncService.syncRecordings()
                  .then(function () {
                        alertsService.addAlert('success', 'Sync completed successfully.');
                      },
                      function () {
                        alertsService.addAlert('danger', 'There was an issue connecting to your tablo.');
                      })
                  .finally(function () {
                    $scope.syncing = false;
                  });
            };
          }]
        };
      }]);
})(window.angular);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tablo_connect-0.0.4 app/assets/javascripts/tablo_connect/ng_app/modules/tablo_sync/directives/tablo_sync_directive.js
tablo_connect-0.0.3 app/assets/javascripts/tablo_connect/ng_app/modules/tablo_sync/directives/tablo_sync_directive.js
tablo_connect-0.0.2 app/assets/javascripts/tablo_connect/ng_app/modules/tablo_sync/directives/tablo_sync_directive.js