(function() { 'use strict'; angular.module('shared') .service('subscriptionRequiredService', ['MessageBox', '$window', 'SiteHelper', 'SiteLinks', function(MessageBox, $window, SiteHelper, SiteLinks) { var service = this; service.show = function(siteId) { MessageBox.show({ message: SiteHelper.siteIdFullnameMap[siteId] + " is required to access this resource", responses: [ { id: 'learn', subtle: true, label: 'Learn More' }, { id: 'order', confirm: true, label: 'Order Now' } ] }).then(function(response) { if(response.id === 'learn') { $window.location.href = SiteLinks.getLearnMoreLink(siteId); } else if (response.id === 'order') { $window.location.href = SiteLinks.getOrderNowLink(siteId); } }) }; } ]) })();