(function () { 'use strict'; var app = angular.module('licencing'); var templatePath = modulesSharedResourcesUrl + 'Modules/Licencing/Views/'; //a directive that renders a completed form (not as a completable form but as markup) app.directive('licenceManager', ['licencingDataContext', '$modal', function (datacontext, $modal) { return { restrict: 'E', scope: { }, templateUrl: templatePath + 'licencemanager.html?version=160718', link: link }; function link(scope, elem, attrs) { scope.licenceAllocationsLoaded = false; datacontext.getMatchingOrganisationsThatRequireLicencing().then(function (organisations) { scope.organisations = organisations; scope.licenceAllocationsLoaded = true; }); scope.viewLicenceAllocation = function (organisation) { $modal.open({ templateUrl: templatePath + 'viewlicenceallocation.html?version=160718', controller: manageLicenceAllocationModalController, resolve: { organisation: function () { return organisation; } } }); } var manageLicenceAllocationModalController = function ($scope, $modalInstance, organisation) { $scope.organisation = organisation; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; } } }]); })();