1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-10 00:46:15 +01:00
fab-manager/app/frontend/src/javascript/directives/home/news.js

23 lines
581 B
JavaScript

Application.Directives.directive('news', [ 'Setting',
function (Setting) {
return ({
restrict: 'E',
templateUrl: '/home/news.html',
link ($scope, element, attributes) {
// The admin blogpost
$scope.homeBlogpost = null;
// constructor
const initialize = function () {
Setting.get({ name: 'home_blogpost' }, function (data) {
$scope.homeBlogpost = data.setting.value;
})
};
// !!! MUST BE CALLED AT THE END of the directive
return initialize();
}
});
}
]);