(function () {
    'use strict';
    // generic UI For listing files
    angular.module('ti_common').directive('ticComponentVersionInfo', ticComponentVersionInfo);
    function ticComponentVersionInfo() {
        return {
            restrict: 'E',
            templateUrl: 'ti_common/nav/component_version_info.html',
            scope: {},
            controller: ticComponentVersionInfoCtrl,
            controllerAs: 'vm',
            bindToController: true
        };
    }
    ticComponentVersionInfoCtrl.$inject = ['$http', 'navSrv'];
    function ticComponentVersionInfoCtrl($http, navSrv) {
        var vm = this;
        vm.navSrv = navSrv;
        vm.componentsList = [];
        vm.showHideText = 'Show Components';
        vm.showingComponents = false;
        $http.get('/ticloudagent/getComponentInfo?os=' + TICloudAgent.getOS())
            .then(function successCallback(response) {
            vm.componentsList = JSON.parse(response.data);
        }, function errorCallback(response) {
        });
        vm.showHide = function () {
            if (vm.showingComponents) {
                vm.showingComponents = false;
                vm.showHideText = 'Show Components';
            }
            else {
                vm.showingComponents = true;
                vm.showHideText = 'Hide Components';
            }
        };
    }
})();
