diff --git a/js/custom.js b/js/custom.js index f2f9b4e..3797019 100755 --- a/js/custom.js +++ b/js/custom.js @@ -73,4 +73,47 @@ defaultTitle: '' }); + // WRLC announcement banner + angular + .module('wrlcAnnounce', ['ngAnimate']) + .component('prmSearchBarAfter', { + template: ` + +
+ + {{ $ctrl.message }} + {{ $ctrl.message }} + +
+
+ `, + controller: + function announceController(announceConfig, $http) { + + var self = this; + var config = announceConfig; + + // get show announcement + $http.get(config.announceAPI) + .then(function(response){ + // Test if we want to show the banner or not + if (config.getShow(response) == "TRUE") { + self.show = true; + } else { + self.show = false; + } + // get message and link using configured functions + self.message = config.getMessage(response); + self.link = config.getLink(response); + + }); + self.wrDismiss = function() { + self.dismissed = true; + } + } + + }); + })();