controller.js 1.03 KB
angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoController', [
    '$scope', 'focaAdminSeguimientoService', '$location', '$routeParams',
    function($scope, focaAdminSeguimientoService, $location, $routeParams) {
        $scope.actividad = '';

        $scope.now = new Date();

        if ($routeParams.parametro === 'nota-pedido') {
            $scope.actividad = 'Nota de pedido';
        } 
        
        if ($routeParams.parametro === 'hoja-ruta') {
            $scope.actividad = 'Entrega de producto';
        }

        $scope.general = true;

        console.info($scope.actividad);
        $scope.marcadores = [];

        focaAdminSeguimientoService.obtenerActividad().then(function(datos) {
            $scope.marcadores = datos.data;
        });

        $scope.general = function() {
            $scope.general = true;
        };

        $scope.individual = function() {
            $scope.general = false;

        };

        $scope.salir = function() {
            $location.path('/');
        };
    }
]);