mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-11 05:54:15 +01:00
42 lines
862 B
JavaScript
42 lines
862 B
JavaScript
|
/* eslint-disable
|
||
|
no-return-assign,
|
||
|
no-undef,
|
||
|
*/
|
||
|
'use strict';
|
||
|
|
||
|
Application.Controllers.controller('StoreController', ['$scope', 'CSRF', 'growl', '$state',
|
||
|
function ($scope, CSRF, growl, $state) {
|
||
|
/* PRIVATE SCOPE */
|
||
|
|
||
|
/* PUBLIC SCOPE */
|
||
|
|
||
|
/**
|
||
|
* 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();
|
||
|
}
|
||
|
|
||
|
]);
|