forked from ~ulysseskao/xdashangular

Dennis Kao
2016-04-26 b53b800719dcab672a116b0cc491a08ef05ef9b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * Alerts Controller
 */
 
angular
    .module('RDash')
    .controller('AlertsCtrl', ['$scope', AlertsCtrl]);
 
function AlertsCtrl($scope) {
  $scope.alerts = [{
    type: 'success',
    msg: 'Thanks for visiting! Feel free to create pull requests to improve the dashboard!'
  }, {
    type: 'danger',
    msg: 'Found a bug? Create an issue with as many details as you can.'
  }];
 
  $scope.addAlert = function () {
    $scope.alerts.push({
      msg: 'Another alert!'
    });
  };
 
  $scope.closeAlert = function (index) {
    $scope.alerts.splice(index, 1);
  };
}