2020-01-22 12:23:51 +01:00
|
|
|
Application.Directives.directive('news', [ 'Setting',
|
|
|
|
function (Setting) {
|
|
|
|
return ({
|
|
|
|
restrict: 'E',
|
2020-09-22 14:46:13 +02:00
|
|
|
templateUrl: '../../../../templates/home/news.html',
|
2020-01-22 12:23:51 +01:00
|
|
|
link ($scope, element, attributes) {
|
|
|
|
// The admin blogpost
|
|
|
|
$scope.homeBlogpost = null;
|
|
|
|
|
2020-01-22 12:43:08 +01:00
|
|
|
// constructor
|
2020-01-22 12:23:51 +01:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
]);
|