SHARE
TWEET
Untitled
a guest
Oct 12th, 2016
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- angular.module('angularDemo.messagingFactory', []).factory("messagingService", messagingService);
- function messagingService($rootscope, $scope) {
- var factory = {};
- factory.events=[];
- var getEvent = function(eventName){
- return factory.events[eventName];
- };
- factory.on = function(eventName, callback) {
- var eventId = factory.getEventId();
- };
- factory.emit = function(eventName, data, callback) {
- factory.events.push({
- "eventName": eventName,
- "data", data,
- "callback": callback
- });
- };
- return factory;
- }
- messagingService.$inject = ['$rootscope', '$scope'];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
