docker/playmaker/playmaker/static/app.controller.js
2021-01-09 21:06:20 +03:00

29 lines
623 B
JavaScript

angular.module('playmaker').controller('notify', [
'$scope',
'global',
function($scope, global) {
$scope.alerts = [];
$scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1);
};
global.addAlert = function(type, msg) {
newAlert = {
type: type,
msg: msg
};
$scope.alerts.push(newAlert);
};
}]);
angular.module('playmaker').controller('navbar', [
'$location',
'$scope',
'$rootScope',
function($location, $scope, $rootScope) {
$rootScope.$on('$routeChangeSuccess', function() {
$scope.path = $location.path();
});
}]);