/**
* @ngdoc main
* @name main_services
* @module s4c.components.main.main_services
*
* @description Componente para acesso a api do backend e/ou comunicação entre controllers.
*
*
*/
(function () {
'use strict';
/**
* @method MainService
* @param {*} CommService
*/
function MainService(CommService) {
var listeners = {};
/**
* @method on
* @param {*} channel
* @param {*} callback
*/
function on(channel, callback) {
if (!listeners[channel]) {
CommService.on(channel, callback);
listeners[channel] = callback;
}
}
return {
on: on
};
}
angular.module('s4c.controllers.MainCtrl')
.service('MainService', MainService);
MainService.$inject = ['CommService'];
}());