mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
24 lines
724 B
JavaScript
24 lines
724 B
JavaScript
/**
|
|
* Controller used in abuses management page
|
|
*/
|
|
Application.Controllers.controller('AbusesController', ['$scope', '$state', 'Abuse', 'abusesPromise', 'growl', '_t',
|
|
function ($scope, $state, Abuse, abusesPromise, growl, _t) {
|
|
/* PUBLIC SCOPE */
|
|
|
|
// List of all reported abuses
|
|
$scope.abuses = [];
|
|
|
|
/* PRIVATE SCOPE */
|
|
/**
|
|
* Kind of constructor: these actions will be realized first when the controller is loaded
|
|
*/
|
|
const initialize = function () {
|
|
// we display only abuses related to projects
|
|
$scope.abuses = abusesPromise.abuses.filter(a => a.signaled_type === 'Project');
|
|
};
|
|
|
|
// !!! MUST BE CALLED AT THE END of the controller
|
|
return initialize();
|
|
}
|
|
]);
|