1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-03 14:24:23 +01:00
fab-manager/app/assets/javascripts/directives/home/projects.js.erb
2020-05-25 12:55:01 +02:00

26 lines
697 B
Plaintext

Application.Directives.directive('projects', [ 'Project',
function (Project) {
return ({
restrict: 'E',
templateUrl: '<%= asset_path "home/projects.html" %>',
link ($scope, element, attributes) {
// The last projects published/documented on the platform
$scope.lastProjects = null;
// The default slide shown in the carousel
$scope.activeSlide = 0;
// constructor
const initialize = function () {
Project.lastPublished(function (data) {
$scope.lastProjects = data;
})
};
// !!! MUST BE CALLED AT THE END of the directive
return initialize();
}
});
}
]);