blob: 163df825b692d1f4b5aa2ad848eec2fcbb180df8 [file] [log] [blame]
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07001window.angular && (function(angular) {
2 'use strict';
Iftekharul Islamc0161392017-06-14 15:46:15 -05003
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07004 angular
5 .module('app.common.directives')
6 .directive('firmwareList', ['APIUtils', function(APIUtils) {
7 return {
8 'restrict': 'E',
9 'template': require('./firmware-list.html'),
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;
18 $scope.activate = function(imageId, imageVersion, imageType) {
19 $scope.$parent.activateImage(imageId, imageVersion, imageType);
20 };
Iftekharul Islamc0161392017-06-14 15:46:15 -050021
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070022 $scope.delete = function(imageId, imageVersion) {
23 $scope.$parent.deleteImage(imageId, imageVersion);
24 };
Iftekharul Islam1acb4122017-11-02 13:20:32 -050025
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070026 $scope.changePriority = function(imageId, imageVersion, from, to) {
27 $scope.$parent.changePriority(imageId, imageVersion, from, to);
28 };
29 }]
30 };
31 }]);
Gunnar Mills6473a412018-03-01 16:19:37 -060032})(window.angular);