mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-03 14:24:23 +01:00
27 lines
728 B
Plaintext
27 lines
728 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;
|
||
|
|
||
|
/* PRIVATE SCOPE */
|
||
|
|
||
|
/**
|
||
|
* Kind of constructor: these actions will be realized first when the directive is loaded
|
||
|
*/
|
||
|
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();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
]);
|