'use strict';
app.controller('alertController', ['$scope', '$http', 'lib', 'authService', function ($scope, $http, lib, authService) {

	var init = function () {

		if (!authService.isAuthenticated()) {
			return;
		}

		$http.get('/Api/Alerts/').then(function (response) {
			$scope.alerts = response.data;
		}, lib.handleRestError);
	};

	init();

}]);
