1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-11 22:24:21 +01:00
fab-manager/app/assets/javascripts/controllers/home.js

27 lines
810 B
JavaScript
Raw Normal View History

2018-11-21 11:08:53 +01:00
'use strict';
2015-05-05 03:10:25 +02:00
Application.Controllers.controller('HomeController', ['$scope', '$stateParams', 'homeContentPromise',
function ($scope, $stateParams, homeContentPromise) {
/* PUBLIC SCOPE */
2015-05-05 03:10:25 +02:00
// Home page HTML content
$scope.homeContent = homeContentPromise;
2015-05-05 03:10:25 +02:00
2018-11-21 10:59:07 +01:00
/* PRIVATE SCOPE */
2015-05-05 03:10:25 +02:00
2018-11-21 10:59:07 +01:00
/**
* Kind of constructor: these actions will be realized first when the controller is loaded
*/
2018-11-21 10:59:07 +01:00
const initialize = function () {
// if we recieve a token to reset the password as GET parameter, trigger the
// changePassword modal from the parent controller
if ($stateParams.reset_password_token) {
2018-11-21 11:08:53 +01:00
return $scope.$parent.editPassword($stateParams.reset_password_token);
2018-11-21 10:59:07 +01:00
}
2018-11-21 11:08:53 +01:00
};
2015-05-05 03:10:25 +02:00
2018-11-21 10:59:07 +01:00
// !!! MUST BE CALLED AT THE END of the controller
2018-11-21 11:08:53 +01:00
return initialize();
2018-11-21 10:59:07 +01:00
}
2018-11-21 11:08:53 +01:00
]);