blob: a4cc58f805f496546d8efebc9e227154adb07dd0 [file] [log] [blame]
Iftekharul Islamc0161392017-06-14 15:46:15 -05001window.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 Tanousbbcf6702017-10-06 13:53:06 -07009 'template': require('./firmware-list.html'),
Iftekharul Islamc0161392017-06-14 15:46:15 -050010 '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 Millse7f83972018-03-21 11:03:35 -050018 $scope.activate = function(imageId, imageVersion){
19 $scope.$parent.activateImage(imageId, imageVersion);
Iftekharul Islamc0161392017-06-14 15:46:15 -050020 }
21
Gunnar Mills607a1202018-03-01 16:26:50 -060022 $scope.delete = function(imageId, imageVersion){
23 $scope.$parent.deleteImage(imageId, imageVersion);
Iftekharul Islamc0161392017-06-14 15:46:15 -050024 }
Iftekharul Islam1acb4122017-11-02 13:20:32 -050025
Gunnar Mills6473a412018-03-01 16:19:37 -060026 $scope.changePriority = function(imageId, imageVersion, from, to){
27 $scope.$parent.changePriority(imageId, imageVersion, from, to);
Iftekharul Islam1acb4122017-11-02 13:20:32 -050028 }
Iftekharul Islamc0161392017-06-14 15:46:15 -050029 }]
30 };
31 }]);
Gunnar Mills6473a412018-03-01 16:19:37 -060032})(window.angular);