Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 1 | window.angular && (function (angular) { |
| 2 | 'use strict'; |
| 3 | |
| 4 | angular |
| 5 | .module('app.common.directives') |
| 6 | .directive('firmwareList', ['APIUtils', function (APIUtils) { |
| 7 | return { |
| 8 | 'restrict': 'E', |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame] | 9 | 'template': require('./firmware-list.html'), |
Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 10 | 'scope': { |
| 11 | 'title': '@', |
| 12 | 'firmwares': '=', |
| 13 | 'filterBy': '=', |
| 14 | 'version': '=' |
| 15 | }, |
| 16 | 'controller': ['$rootScope', '$scope','dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout){ |
| 17 | $scope.dataService = dataService; |
Gunnar Mills | e7f8397 | 2018-03-21 11:03:35 -0500 | [diff] [blame^] | 18 | $scope.activate = function(imageId, imageVersion){ |
| 19 | $scope.$parent.activateImage(imageId, imageVersion); |
Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 20 | } |
| 21 | |
Gunnar Mills | 607a120 | 2018-03-01 16:26:50 -0600 | [diff] [blame] | 22 | $scope.delete = function(imageId, imageVersion){ |
| 23 | $scope.$parent.deleteImage(imageId, imageVersion); |
Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 24 | } |
Iftekharul Islam | 1acb412 | 2017-11-02 13:20:32 -0500 | [diff] [blame] | 25 | |
Gunnar Mills | 6473a41 | 2018-03-01 16:19:37 -0600 | [diff] [blame] | 26 | $scope.changePriority = function(imageId, imageVersion, from, to){ |
| 27 | $scope.$parent.changePriority(imageId, imageVersion, from, to); |
Iftekharul Islam | 1acb412 | 2017-11-02 13:20:32 -0500 | [diff] [blame] | 28 | } |
Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 29 | }] |
| 30 | }; |
| 31 | }]); |
Gunnar Mills | 6473a41 | 2018-03-01 16:19:37 -0600 | [diff] [blame] | 32 | })(window.angular); |