(function () { 'use strict'; //controller that handles notifications stuff var controllerId = 'badgesController'; angular.module('app').controller(controllerId, ['common', 'user', 'config', '$routeParams', '$scope', '$modal', '$rootScope', 'myUsersDataContext', 'OrganisationAdminService', 'features', 'licencingAdminDataContext', badgesController]); function badgesController(common, user, config, $routeParams, $scope, $modal, $rootScope, myUsersDataContext, OrganisationAdminService, features, licencingAdminDataContext) { var getLogFn = common.logger.getLogFn; var log = getLogFn(controllerId); var logSuccess = getLogFn(controllerId, "success"); var vm = this; vm.templateId = $routeParams.templateId; vm.issueType = $routeParams.issueType; activate(); function activate() { NProgress.done(); getFeatures(); getLicences(); log('Activated Badges View'); } $rootScope.$on('UpdateLicence', function (event, args) { getLicences(); }); function getFeatures() { OrganisationAdminService.getTopLevelOrg().then(function (org) { features.getCurrentFeatures(org.id).then(function (features) { vm.features = features; }); }); } function getLicences() { OrganisationAdminService.getTopLevelOrg().then(function (org) { licencingAdminDataContext.getCurrentLicense(true).then(function (data) { vm.licences = data; }); }); } } })();