{"size": 473, "ext": "js", "max_stars_repo_path": "app/src/pages/admin/service/eventBus.js", "max_stars_repo_name": "nik0lica/mean-demo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/src/pages/admin/service/eventBus.js", "max_issues_repo_name": "nik0lica/mean-demo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/src/pages/admin/service/eventBus.js", "max_forks_repo_name": "nik0lica/mean-demo", "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": 23.65, "max_line_length": 67, "alphanum_fraction": 0.4989429175}
(function(){
    'use strict';
    angular.module('adminApp')
        .service('eventBus', eventBus);
    
    function eventBus($rootScope) {

        this.emit = function (topic, data) {
            $rootScope.$emit(topic, data);
        }
        this.onEvent = function (topic, func, scope) {
            return $rootScope.$on(topic, func);

            if(scope){
                scope.$onDestroy($rootScope.$$listeners.topic =[]);
            }
        }
    }

}());