{"size": 1298, "ext": "js", "max_stars_repo_path": "public_html/js/system/components/header/header.js", "max_stars_repo_name": "Niksokupa/trolleyes-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public_html/js/system/components/header/header.js", "max_issues_repo_name": "Niksokupa/trolleyes-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public_html/js/system/components/header/header.js", "max_forks_repo_name": "Niksokupa/trolleyes-client", "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": 27.0416666667, "max_line_length": 64, "alphanum_fraction": 0.6325115562}
moduleComponent.component('headerComponent', {
    //restrict: 'A',
    templateUrl: 'js/system/components/header/header.html',
    bindings: {
        prueba: '='
    },
    controllerAs: 'c',
    controller: js
});

function js(toolService, sessionService) {
    var self = this;
    var cart = $('.trolley');
    var cartDiv = $('.highlight');

    self.logged = sessionService.isSessionActive();
    self.name = sessionService.getUserName();
    self.idUserLogged = sessionService.getId();
    self.isActive = toolService.isActive;
    self.isAdmin = sessionService.isAdmin();
    self.carrito = sessionService.getCountCarrito();



    sessionService.registerObserverCallback(function () {
        self.name = sessionService.getUserName();
    })
    sessionService.registerObserverCallback(function () {
        self.isAdmin = sessionService.isAdmin();
    })

    sessionService.registerObserverCallback(function () {
        self.carrito = sessionService.getCountCarrito();

        if (self.prueba) {
            cart.effect("shake", {
                times: 2
            }, 400);
            cartDiv.effect("highlight", {color:"#f4ce42"}, 400);
        }


    })
    sessionService.registerObserverCallback(function () {
        self.logged = sessionService.isSessionActive();
    })

}