1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-02 13:24:20 +01:00
fab-manager/app/assets/javascripts/directives/news.js.erb
2020-01-22 12:43:08 +01:00

23 lines
600 B
Plaintext

Application.Directives.directive('news', [ 'Setting',
function (Setting) {
return ({
restrict: 'E',
templateUrl: '<%= asset_path "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();
}
});
}
]);