21 lines
538 B
JavaScript
21 lines
538 B
JavaScript
/**
|
|
* 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) {
|
|
$scope.messages = [];
|
|
try {
|
|
ApiService.getMessages().then(function (data) {
|
|
$scope.messages = data['messages'] || [];
|
|
});
|
|
}
|
|
}
|
|
};
|
|
});
|