This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/quay-message-bar.js

24 lines
650 B
JavaScript
Raw Normal View History

/**
* An element which displays a message for users to read.
*/
angular.module('quay').directive('quayMessageBar', function () {
return {
priority: 0,
templateUrl: '/static/directives/quay-message-bar.html',
replace: false,
transclude: false,
restrict: 'C',
scope: {},
controller: function ($scope, $element, ApiService, NotificationService) {
$scope.messages = [];
$scope.NotificationService = NotificationService;
ApiService.getGlobalMessages().then(function (data) {
2016-10-10 18:42:33 +00:00
$scope.messages = data['messages'] || [];
}, function (resp) {
return true;
});
}
};
});