{"size": 945, "ext": "js", "max_stars_repo_path": "web/js/controllers/home.js", "max_stars_repo_name": "JoPaRoRo/Fleet", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/js/controllers/home.js", "max_issues_repo_name": "JoPaRoRo/Fleet", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/js/controllers/home.js", "max_forks_repo_name": "JoPaRoRo/Fleet", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.4838709677, "max_line_length": 119, "alphanum_fraction": 0.4740740741}
/**
 * Created by Jos�Pablo on 10/28/2015.
 */
angular.module('MetronicApp').controller('HomeCtrl',function ($scope, GetSv) {

        $scope.alerts = [];
        $scope.closeAlert = function (index) {
            $scope.alerts.splice(index, 1);
        };

        $scope.datos = {};

        $scope.getDatos = function () {
            GetSv.getData("HomeSv").then(function (data) {
                if (data.Error) {
                    $scope.alerts.push({type: "danger", msg: data.Error});
                } else {
                    $scope.datos = data;
                }
            }, function (e) {
                $scope.alerts.push({type: "danger", msg: e});
            });
        };

        $scope.getDatos();

        $scope.promedioMontacargas = function () {
            return (($scope.datos.total_montacargas_mantenimiento / $scope.datos.total_montacargas) * 100).toFixed(2);
        };

    });