2022-08-16 18:53:11 +02:00
|
|
|
'use strict';
|
|
|
|
|
2022-09-21 17:36:45 +02:00
|
|
|
Application.Controllers.controller('StoreController', ['$scope', 'CSRF', 'growl', '$uiRouter',
|
|
|
|
function ($scope, CSRF, growl, $uiRouter) {
|
2022-08-16 18:53:11 +02:00
|
|
|
/* PUBLIC SCOPE */
|
|
|
|
|
2022-09-26 17:18:52 +02:00
|
|
|
// the following item is used by the Store component to store the filters in the URL
|
2022-09-21 17:36:45 +02:00
|
|
|
$scope.uiRouter = $uiRouter;
|
|
|
|
|
2022-08-16 18:53:11 +02:00
|
|
|
/**
|
|
|
|
* Callback triggered in case of error
|
|
|
|
*/
|
|
|
|
$scope.onError = (message) => {
|
|
|
|
growl.error(message);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback triggered in case of success
|
|
|
|
*/
|
|
|
|
$scope.onSuccess = (message) => {
|
|
|
|
growl.success(message);
|
|
|
|
};
|
|
|
|
|
|
|
|
/* PRIVATE SCOPE */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Kind of constructor: these actions will be realized first when the controller is loaded
|
|
|
|
*/
|
|
|
|
const initialize = function () {
|
|
|
|
// set the authenticity tokens in the forms
|
|
|
|
CSRF.setMetaTags();
|
|
|
|
};
|
|
|
|
|
|
|
|
// init the controller (call at the end !)
|
|
|
|
return initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
]);
|